QuickWatch Dialog Box

Home Page (Debugger)OverviewHow Do I... Topics

The QuickWatch dialog box contains a text box, where you can type an expression or variable name, and a spreadsheet field that displays the current value of the variable or expression that you specified.

You can use QuickWatch to quickly examine the value of a variable or expression. You can also use QuickWatch to modify the value of a variable or to add a variable or expression to the Watch window.

The Current Value spreadsheet field displays only one variable or expression at a time. If you type a new variable or expression in the text box and press ENTER, the previous variable or expression in the Current Value field is replaced.

Display of a Scalar Variable or Expression

If you type a scalar variable or expression in the text box, QuickWatch displays the result on the first line of the spreadsheet. If you type an array, object, or structure variable, however, QuickWatch uses the spreadsheet to show additional detail. Plus sign (+) and minus sign (-) boxes appear. Click these boxes to expand or collapse your view of the variable.

Display of an Object, Reference or C++ Object Pointer

If the variable is an object, reference or C++ pointer to an object, QuickWatch automatically expands the variable to show the most important data at the top level. For example, suppose you had the following C++ object:

CString String  =   {...}
char *   m_pchData =0x7ffdf000 "abc"
   int          m_nDataLength=4
   int          m_nAllocLength=1244628

QuickWatch would display the following:

CString String  =   {"abc"}

Display of an Object

If the variable is a C++ pointer or reference to an object, QuickWatch automatically downcasts the reference or pointer. QuickWatch adds an extra member to the expanded object. This extra member, which looks like another base class, indicates the derived subclass. For example, if a variable declared as a C++ pointer to CObject really points to CComboBox, QuickWatch recognizes this fact and adds an extra member so that you can access the CComboBox members.

QuickWatch displays values in their default format. You can change the display format (to display Unicode characters, for example) using formatting symbols. For details, see Symbols for Watch Variables.

What do you want to do?

View the Value of a Variable

Modify the Value of a Variable