Debug the Application (Compact 7)
In the previous task, you ran your application. In this task, you set a breakpoint in your application and then run the debugger so that it stops at the breakpoint. When you debug an application in Platform Builder, you use the standard Visual Studio debugging commands (F11 to step into, F10 to step over, and so on).
To debug an application
If the Hello World application is running on your vCEPC, click the close (X) button on the Getting Started window to exit the program.
In Platform Builder, in your subproject, double-click HelloWorld.cpp to display the code.
In HelloWorld.cpp, in function
WndProc, put your cursor anywhere in the line that reads
Press F9 to insert a breakpoint. The breakpoint appears as a hollow circle with a yellow caution triangle, as shown in the following figure. Your breakpoints only become solid red when the application is running on your device.
Also insert a breakpoint at line
In Platform Builder, click Target, and then click Run Programs.
In the Run Program dialog box, under Available Programs, click HelloWorld.exe, and then click Run. The Hello World application window appears on the vCEPC, and in Platform Builder, the application is stopped at line
GetClientRect(hWnd, &rt);. Note that the breakpoints are now red, as shown in the following figure.
Press F5 to stop at the second breakpoint.
Press F5 to resume execution of the application.
For information about how to use the debugger, see Debugging.