![]() |
Chapter 7 | ![]() |
Just a note - most of the navigation in MSVC is made with mouse clicks, either on menus or on popup icons. Only a very VERY
small amount of interaction can be obtained via the keyboard. Keep this in mind when I describe some of the features. For now, I'll
use the arrow mark, , to denote menu navigation. Thus, File
Exit, means to go to the File menu, and select the Exit subitem.
We're going to start by making a large assumption - that you're using a project that was created with the wizard, or that
someone has (correctly) hand tailored to include a Debug configuration. You can do this yourself by simply creating a new project
(File New
New Project, select Console Application, and then use Project
Add To Project
Files, to selet your files.). This will
automatically create a Debug and Release configuration for your project! You will still have to add the networking libs manually however.
To insure that your debugging release is built, go to Build Set Active Configuration, and select your Debug version.
If you're going to do it manually, you're on your own. Microsoft does have documentation on the command-line options for their compiler and preprocessor, but generally speaking, that's deep wizardry. It's not that it's hard, it's just that MS wants you to use their automatic stuff, and documentation usually seems to be hard to find/non-existant/simply wrong. Don't bother using or learning the specific options unless there's some document or other scary pointer which says 'use it!'.
One other quick note needs to be made - Microsoft is the master of confusion, and they've outdone themselves with MSVC. MSVC is one of the few pieces of software that I advise you find someone who knows the software to ask, before you hit the documentation. Some examples include renaming every other standard C library function, only to remap them internally with defines or the sort (such as strcmp() and strcasecmp() becoming _strcmp() or _stricmp() for string matching), and having not one set of documentation for a given function/command/control/etc, but having all sets of documentation for every single feature/etc that has ever existed, for all versions, all patch levels, all mixed together. If you're using an example from the MSDN CD, you may very well find out that it not only does not compile, but that the functions it uses no longer work! (This is especially true regarding the printing, display, and other used-to-be-direct-access models).
The first rule of thumb with MSVC is: DON'T ASSUME THE SOFTWARE OR DOCUMENTATION IS RIGHT!
To counteract this horrible liability, MSVC has all sorts of hidden goodies inside it. Unlike gdb, it can easily be set up to inline replace macros with the correct code (allowing you to easily trace through macros). Microsoft has guaranteed default values for uninitalized and freed memory and other such incredibly useful goodies. If you're planning on being a devoted windows hacker, you're going to want to find these little tricks; they are very well hidden, but very much worth the trouble of finding.
I'll cover these little gotcha's as well as any tricks I can pull out of my sleeve, but don't consider the list to be all inclusive. Microsoft engineers are better at writing bugs in their own compiler and IDE than I am at figuring workarounds for them.
![]() |
Index | ![]() |
6.1.4.6 Starting GDB on an Already Running Program | 7.1 Known Tricks, Problems, and Pratfalls with MSVC |