Home > Software engineering >  Use MFC cfile write files abnormal abnormal value of 2 could you tell me what should I do?
Use MFC cfile write files abnormal abnormal value of 2 could you tell me what should I do?

Time:09-17

Such as title, incredibly strange when writing to a mistake

CodePudding user response:

DWORD err=GetLastError ();//ERROR_FILE_NOT_FOUND=2 (" CMD ")

CodePudding user response:

With the complete path + name of the file, if it is a relative path and App, can use the GetModuleFileName to get the App file name, and then constructs the absolute path

CodePudding user response:

refer to the second floor zgl7903 response:
with the complete path + name of the file, if it is a relative path and App, can use the GetModuleFileName to get the App file name, and then constructs the absolute path


It turns out that the local variable is the function problem
Because of this function is an infinite loop cfile field has been in this function and I in the program Settings file open only once so always go wrong
It is good to set the cfile global

But seemingly cfile cannot be use in the window class?

CodePudding user response:

Cfile cannot be use in the window class?
Not too!

CodePudding user response:

reference 4 floor schlafenhamster response:
cfile cannot be use in the window class?
Not too!
what? Is still not a duck

CodePudding user response:

Cfile can used in the window class
  • Related