Use Debug in VC
Select Debug Compilation Options Build -> Set Active Configuration -> Win32 Debug or Select Debug in the ListBox on the Build toolbar. Debug defines the _debug macro, and Release defines the NDebug macro. Press F12 to compile Browse information, you can find the variable definition after compiling. Execute Debug Press F5 (note that if the Ctrl F5 is RUN, the DEBUG is not found). Be sure to pull the debug tool bar when Debug is convenient to debug. Breakpoints (F9) can edit all breakpoints with Alt F9. The command address (EIP) specifies that the breakpoint is interrupted when the value of the EIP is specified. As shown below: It is set to the address of the setWindowlong (Note: Be sure to add 0x in front). Setting breakpoints for memory address setting When the specified memory address changes (in runtime settings). Show next statement displays the code location STEP OVER (F10) where the current command is located, encountering the Call statement does not enter the Step Into (F11) single step tracking, encounter a Call statement to enter Step Out (SHIFT F11) Jump out the current function call Run to Cursor (Ctrl F10) Run to the position of the cursor. Memory Leaks memory leakage. To check to Memory Leaks, you must include header file (actually #pragma comment (lib, "mfc42ud.lib") works). Note: Memory leaks are a very serious problem, especially for programs that require long-term operation (process long keep in memory). There is an important fact that when the process is properly exited, the operating system is responsible for emptying all memory. QuickWatch (SHIFT F9) can change the value of the variable runtime. Watch window Enter "Err, HR" to dynamically view getLastError information. You can enter the register. (long *) ESP can view the stack content. Variables window The local variable of the current function of the Variables window EIP, ESP, and the ECX Memory window can drag and drop. Options-> DebUG You can set the Call Stack window Disassembly window set next statement Skip certain statements (sometimes used for HACK) GOTO SOURCTRL G In% System% directory, the content is as follows: dumpbin / exports% 1 > a.txta.txt View Apply Change Changes for DLL Output Functions (Alt F10) When you are in a debugging state, this command can be executed if the code is changed, allowing you to run to the current state. Debug-> Modules Window Profile (BUILD menu) To set up Project -> settings -> link -> enable profiling assert, Verify TRACE is output in the debug state, and requires Enable Tracing to open. AfxMessageBox Cout, Printf outputs OutputDeBugString OutputDebugString OutputDebugString Output in Debug and Release. DebugBreak, _ASM {INT 3} Force Interrupt How to DEBUG for the Release version is set, and then you can perform DEBUG.