Environment: Visual C++ 6
You may have noticed that for example CString instaces do not show up as `{...}´ in debug windows (watch, variable, etc. and in tooltip when you move the pointer on a variable). Rather, CString "smartly" shows up as `{"string"}´. This feature can be customized to make your own classes appear smartly while debugging, so that you can see the most crucial member varibles at first glance rather than having to expand the non-meaningful `{...}´ at first.
The definitions for the custom formatting reside in autoexp.dat in Common\MSDev98\Bin directory. The file has a fairly good documentation in it, and some good examples as well (including the CString one.) As with the usertype.dat (that has been dealt with in another article here), you'll have to restart MSVC to have the changes take effect.
This is a snippet from the file itself - it explains the syntax quite well.
; type=[text]... ; ; type Name of the type (may be followed by <*> for template ; types such as the ATL types listed below). ; ; text Any text.Usually the name of the member to display, ; or a shorthand name for the member. ; ; member Name of a member to display. ; ; format Watch format specifier. One of the following: ; ; Letter Description Sample Display ; ------ -------------------------- ------------ ------------- ; d,i Signed decimal integer 0xF000F065,d -268373915 ; u Unsigned decimal integer 0x0065,u 101 ; o Unsigned octal integer 0xF065,o 0170145 ; x,X Hexadecimal integer 61541,X 0X0000F065 ; l,h long or short prefix for 00406042,hx 0x0c22 ; d, i, u, o, x, X ; f Signed floating-point 3./2.,f 1.500000 ; e Signed scientific-notation 3./2.,e 1.500000e+000 ; g Shorter of e and f 3./2.,g 1.5 ; c Single character 0x0065,c 'e' ; s Zero-terminated string 0x0012fde8,s "Hello world" ; su Unicode string 0x007200c4,su "Hello world" ; st String in ANSI or Unicode depending on current setting ; ; The special format <,t> specifies the name of the most-derived ; type of the object. This is especially useful with pointers or ; references to a base class. ; ; If there is no rule for a class, the base classes are checked for ; a matching rule.
CString =<m_pchData,st>
class Goo { int width; double height; char* name; };
Goo =<name,s> width: <width,i> height: <height,g>
{"a goo" width: 5 height: 3.1}
Date Last Updated: April 18, 1999
Add Comment
INSTANT EXPERTS!Savvy IT Pros report on SupportSource. Take a look inside the largest vault of multi-vendor computing specs ever assembled. Click here for an In-depth Report,. Learn about Free & Open Source software at the Bazaar Conference & Expo!,December 14-16, 1999 in New York City! Click here for more information. For tons of Windows technology resources, check out the Windows Programming directory. Go to Fatbrain for the NEWEST and BEST technical books for IT professionals. Get Linux Utilities for ONLY $34.95 at EarthWeb Direct.