Home > Back-end >  CreateFile return failure code: 3 how to solve?
CreateFile return failure code: 3 how to solve?

Time:09-29

When using Windows API function, there is no format file some files such as: aaa file (instead of aaa. TXT file with the file format) (no suffix), appear this kind of file when using the CreateFile function will go wrong, return an error code: 3 can't find the path to the file; Aaa is considered the folder? What should I do?

CodePudding user response:

A folder and file name repetition, affirmation is not successful,
 char szFile [64]. 
HANDLE HANDLE;
Unsigned long lWritten, lRead;

Handle=CreateFile (L "example", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0).

If (handle==INVALID_HANDLE_VALUE) {

Caption="1";
}

CodePudding user response:

But USES zlib library, extract the zip file, but the zip file contains the file, is fail, but how to handle?
  • Related