Announcement
Collapse
No announcement yet.
PBCC EXE Causing Vista User Act. Control
Collapse
X
-
I am assuming these files are stored in the program's directory. If that happens to be in the {system root}\Program Files... folder on Vista, it will not allow files to be created in that folder without admin rights being requested either via a manifest or within the shortcut for your ap.
-
Thanks
Thanks Paul and Guy, learned something useful again.
Arie Verheul
Leave a comment:
-
Arie,
Why not use the wonderful TRY/CATCH/FINALLY/END TRY Command ?
When you start to use it you will not use anything else for opening any kind of Hard Disk Files.
You can catch all the errors right there.
A programmer's dream come true.....
I would not think of opening files the old way.
And, if you have to write multi-user programs, it is also the best way to lock your files.Last edited by Guy Dombrowski; 16 Aug 2009, 07:12 PM.
Leave a comment:
-
Arie,
you need to check if there was an error:
Code:ERRCLEAR OPEN "D:\File1.txt" FOR INPUT AS #1 IF ERR = 0 THEN PRINT "#1 opened" ELSE PRINT ERROR$ END IF
Leave a comment:
-
I am not sure if this part of the problem or not, but according to the help file, a file that is opened for input must exist.
The code shows two lines that are supposed to restore files, but are commented out.
Restrictions
Attempting to OPEN a file for INPUT that does not exist causes a run-time Error 53 ("File not found").
I can imagine that this may cause strange problems.
Arie Verheul
Code:#Compile Exe #Dim All #Break On Function PBMain () As Long Open "D:\File1.txt" For Input As #1 Print "#1 opened" Open "D:\File2.txt" For Input As #2 Print "#2 opened" Open "D:\File3.txt" For Output As #3 Print "#3 opened" Open "D:\File4.txt" For Output As #4 Print "#4 opened" WaitKey$ End Function
Leave a comment:
-
I "think" that can be solved with a manifest. Search "manifest AND vista" here.
Leave a comment:
-
PBCC EXE Causing Vista User Act. Control
I have compiled hundreds of CC programs and never had this problem. The only difference is that I open 4 sequential files, two for input and two for output at the same time. When I do I get flagged for user control: 'Unidentified Publisher' Do you want to allow this program?
Here is the code section:
A2000_INITIALIZATION:
'SHELL "COPY MSTR91.BAK MSTR91.CSV" '/ RESTORE MASTER FILE
'SHELL "COPY CHKTOT91.BAK CHKTOT91.CSV" '/ RESTORE CHECK FILE
COLOR 6
CLS
PRINT "STUDY PROGRAM 9.1: SALES FILE UPDATE"
PRINT "PROGRAMMER: AMW"
PRINT
OPEN "MSTR91.CSV" FOR INPUT AS #1
OPEN "TRAN91.CSV" FOR INPUT AS #2
OPEN "NEW-MSTR.CSV" FOR OUTPUT AS #3
OPEN "ERR91.CSV" FOR OUTPUT AS #4
HIGH_VALUE$ = "9999"
DETAIL01$ = "#,###,###"
RETURNTags: None
Leave a comment: