Home > database >  Help: PB11 calling createfile function, file not found
Help: PB11 calling createfile function, file not found

Time:09-26

The code is as follows:
The FUNCTION Long CreateFile (string filename, ULong a, ULong b, ULong c, ULong d, ULong e, ULong f) LIBRARY "KERNEL32. DLL" ALIAS FOR "CreateFileA";

Long value, li_fnum
Value=https://bbs.csdn.net/topics/GetFileOpenName (" Select File ", & amp;
+ bilname, named, "bill", & amp;
+ "BIL Files (*. BIL), *. BIL")

Li_fnum=CreateFile (bilname GENERIC_READ, FILE_SHARE_READ, 0,3,0,0)

If li_fnum=1 then
Messagebox (" error ", "unable to open file" + bilname + ", the reason why value is: "+ string (getlasterror ()))
RETURN
End the if

The result has been an error, getlasterror error code is 2, file not found,

I put the parameters of the createfile open_existing modified to create_new found him to create the file name the first character of the

Such as files, called "F: \ test. Bill," he under the program in the current directory to create a file F,,, to help everyone, what reason is this

CodePudding user response:

Not so used,
Used the openfile () to create,
  • Related