Visual C++ 6 Unleashed

Visual C++ 6 Unleashed

By MICKEY WILLIAMS and David Bennett

Integrated Debugger

Developer Studio includes a full-featured debugger for fixing those problems that inevitably manage to slip in. A good reference for the debugger is the online help, and we don't have the space to include it all here, so I will just mention a few things that you may find useful. More information about debugging can be found in Chapter 15, "Debugging and Profiling Strategies."

Looking at Your Data

When you are debugging, you will be concerned with the values represented by the variables in your program. The simplest way to do this in Developer Studio is to point the mouse at the variable in the source code and wait a second or two. A small tip box will appear that displays the current value of the variable.

For a more detailed view, you can use the right mouse button to produce a Context menu, which allows you to open a quick watch window for the selected variable. The quick watch window allows you to enter any expression you want to evaluate in the expression window. However, preprocessor constants (including resource ID constants) are generally not available for evaluation. To add this expression to the more permanent watch window, click the Add Watch button.

Debugging After Exceptions

At some time or another, you will almost definitely find yourself with an application that will trip over an unhandled exception. This will bring up a dialog box that will allow you to exit altogether or debug the application. You may actually load the debugger to view the current state of your application at the time of the exception, source code and all, even if you were not running your application from Developer Studio at the time!

Share ThisShare This

Informit Network