Home > Software engineering >  MFC beg god to see what's going on
MFC beg god to see what's going on

Time:10-06



Focus is on CFile file this variable, a plus will trigger the breakpoint

CodePudding user response:

Seek the solution, how to solve

CodePudding user response:

You don't initialize,,,,

CodePudding user response:

I can assure you that your file. Open not open this file, or you change path into an absolute path. You put the map TXT under D disk write fp. Open (" D: \ \ map. TXT ",... )

CodePudding user response:

The second parameter of the Open function is wrong, you use CFile: : modeRead

CodePudding user response:

If (hFile==INVALID_HANDLE_VALUE) return FALSE.//1

CodePudding user response:

How can read files in OnPaint, spending too much
You put the file somewhere else read
OnPaint should be drawn only deals with the related things

CodePudding user response:

refer to 6th floor xianglitian response:
how can read files in OnPaint, spending too much
You put the file somewhere else read
Should be drawn only deals with things related in OnPaint

Very reasonable, OnPaint drawing is very frequent,

CodePudding user response:

CFile open file failed throw an exception
With open CFileException parameters, can avoid direct throw an exception, or try catch catch exceptions

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

CodePudding user response:

refer to 6th floor xianglitian response:
how can read files in OnPaint, spending too much
You put the file somewhere else read
Should be drawn only deals with things related in OnPaint

Agree, in the OnPaint do I/O itself is wrong
  • Related