Stupid VC++ tricks
by Brian Ramage · in Technical Issues · 06/29/2002 (12:32 pm) · 1 replies
Here's a couple of tips that some of you may not know about the Visual C IDE that will make development a bit easier.
- To expand a pointer to an array in the debug Watch window, type the variable, then a comma and a number to indicate how many elements in the array you want to see. Ie, so if you had a pointer to an array foo, and you want to see the first 8 elements of foo, put the following into a watch entry:
foo,8
- Classes can be auto-expanded in the debugger so you don't have to click on simple data like Point3F to see the x,y,z info. To set up auto-expand data, search for the autoexp.dat file in your Visual Studio directory; it'll be in a different place depending on the many variants of VC (Enterprise Edition, Pro Edition, etc). Open autoexp.dat for edit and you will see an explanation at the top for you can customize classes to auto-expand and display class data. Insert your own definitions after the [AutoExpand] tag. I've got mine set to:
VectorF =x= y= z=
Point3F =x= y= z=
Point2F =x= y=
So in the debugger, when I mouse-over a Point3F variable or reference it in the watch window, it'll display:
funkyPoint = {x=4.325235 y=3452.343 z=3.0}
You can also set it up to abbreviate to:
funkyPoint = {x=4.3 y=3452.3 z=3.0}
If you then want the full floating point number, you can click on the variable.
- To expand a pointer to an array in the debug Watch window, type the variable, then a comma and a number to indicate how many elements in the array you want to see. Ie, so if you had a pointer to an array foo, and you want to see the first 8 elements of foo, put the following into a watch entry:
foo,8
- Classes can be auto-expanded in the debugger so you don't have to click on simple data like Point3F to see the x,y,z info. To set up auto-expand data, search for the autoexp.dat file in your Visual Studio directory; it'll be in a different place depending on the many variants of VC (Enterprise Edition, Pro Edition, etc). Open autoexp.dat for edit and you will see an explanation at the top for you can customize classes to auto-expand and display class data. Insert your own definitions after the [AutoExpand] tag. I've got mine set to:
VectorF =x=
Point3F =x=
Point2F =x=
So in the debugger, when I mouse-over a Point3F variable or reference it in the watch window, it'll display:
funkyPoint = {x=4.325235 y=3452.343 z=3.0}
You can also set it up to abbreviate to:
funkyPoint = {x=4.3 y=3452.3 z=3.0}
If you then want the full floating point number, you can click on the variable.
Torque Owner Mike Nelson