To output debugging information for VC programming, you can use the outputdebugstring API function. For example, you can use:
Void ctestdlg: onbutton1 ()
{
//
Todo: add your control notification handler code here
Outputdebugstringa ("Hello!
I am here ");
}
As long as it is a string, you can use it to output the variable value and track the program execution path to find the program bug.
So how to view the output string, you need to use a tool called dbgview, interface:
: Http://download.csdn.net/source/1066665
: Http://download.csdn.net/source/1066650
Once you run dbgview, the string output by calling outputdebugstring is displayed as a record on the dbgview interface. Let's see if you are tempted by this debugging method?
The outputdebugstring function can be used in both application code, dll/lib library code, and driver code, which is universally applicable. Think about it. If your program is composed of several dynamic link libraries, one EXE, and one service, you can use outputdebugstring in any link library, EXE, or service, during the overall joint debugging, these outputdebugstring calls work at the same time, which is really convenient!