# Ifdef_debug
Afxdump <"dumpingmyperson:/N ";
Myperson-> dump (afxdump );
Afxdump <"/N ";
# Endif
1) trace ();/trace0 ();/trace1 ();/trace2 ();/trace3 ();: The method is similar to the printf () function in C; tracen () the difference between trace () and trace () is that the former uses less resources, and N in the former indicates the number of parameters included. Make trace available: Tools-mfctracer-enablingtrace.
2) afxdump (); // similar to cout in C ++;
3) afxdump (constcobject * OBJ); the relevant information (attribute value) of obj is output ).
4) MessageBox ();/afxmessagebox ();
# Ifdef_debug
Afxdump <X;
# Endif
The result is displayed in output and cannot be in release state. CTRL + F5 does not seem to be valid. F5 can.
Afxdump. setdepth (1 );
Set the depth, such as maps and arrays. It only has a few elements. We use this function to type out all the content.
# Ifdef_debug
Chartest [] = "0123456789/N ";
Afxdump. hexdump ("--", (byte *) test, 11,6 );
# Endif
Result:
-- 303132333435
- -36373839 0a
The first parameter indicates the starting character of the line.
The second parameter indicates the content to be played.
The third parameter indicates the number of elements to be played.
The fourth parameter indicates the number of rows.
4. Trace (...), trace0, trace1, trace2, and trace3 can only be a string of up to 512 characters including Terminator.
5. In the debug status
After F9 sets the breakpoint, F5 goes to the next breakpoint, and F11 goes into the function (including system functions) in the next line of F10. Shift + F11 goes out.
After F5, the Debug menu has corresponding menu items.
After F5, view-> debugwindow sub-menu items are more useful.
Watch to view your specified variables
Variables: displays the value of auot, local, and this.
Memory displays the storage value of the specified memory address
Callstack displays the function call relationship
Value of the registers register
Disabblemble assembly code
In fact, you can debug F5 in release.
Alt + F7 Project Settings
Select C/C ++ generatebrowseinfo.
Debuginfo select progamedatabaseforeditandcontinue
Linkgeneratedebuginfo selected
Choose linkincrementally