15.5. Advanced Tips and Tricks

Microsoft Visual C++/Microsoft Foundation Classes


15.5. Advanced Visual C++ Tips and Tricks

15.5.1. How do I see the MSVC 'Easter Eggs'?!

FYI: Easter eggs are hidden screens that usually have secret initials, development team names, etc..

  • To see the spinning PLUS with the MSVC team members:
In MSVC 2.0 or 2.1:
A. Bring up the about box: help/about
B. Press control-tab and double click in the middle of the box at the same time.
NOTE: You must have the MSVC CD loaded for this to work, I think.
If above does not work, try this-> copy the MSVCCRD.DLL from the CD to msvc\bin.   CTRL+Double-click the picture in the dialog.
 
note: release the CTRL key at the same time as the second click.
 
[email protected], Jeff O'Halloran
  • To see the Visual C++ 4.0 about box, double click in the about box while the CD-ROM is in the drive and you are holding the control key down. The OK button should go away. Wait about 3-5 minutes and you should see a pretty neat flight simulator! You can browse the picture by opening msdevcrd.dll which lives in msdev\bin.
[email protected]

15.5.2. What are the command line options to MSVC?

  • MSVC /V - Runs the compiler in a dos box (version 1.5 only?)
[email protected]
  • MSVC /NOLOGO - Runs MSVC without the about box, saves second or 2.
  • MSVC /bppassc:yes - Enables a cool breakpoint counter in the 'breakpoints' dialog (under the Debug menu).
[email protected], email 7/11/95
  • MSVC -p - attaches VC++ to a process.

15.5.3. How to change the color of ClassWizard generated code!

The default color for text modified by the ClassWizard is black print on a white background. Visual C++ is aware of the code that the ClassWizard modifies and can highlight these changes for you using a different color.

Highlighting the text ClassWizard modifies makes the new modifications very obvious and easy to find. To do this, from the Tools menu, choose Options. Then select the Format tab in the Options dialog box. From the Colors Listbox, select Wizard Code. Then define the colors for text and the background.

NOTE: Only applies to VC++ 2.x (and 4.x), but it's waaaay cool!

MS FAQ, 6/25/95

15.5.4. Ten cool things you can do in the VC++ editor!

  1. CTRL+ALT+T shows your tab characters
  2. SHIFT+ESC closes the active dockable window
  3. CTRL+F3 finds the next occurrence of the current word
  4. CTRL+M finds the matching bracket
  5. CTRL+> and CTRL+< find the next/prev matching #ifdef/#else/#endif
  6. CTRL+SHIFT+R starts/stops macro recording
  7. CTRL+SHIFT+P plays recorded macro
  8. Right-click #includes to open the header file
  9. TAB/SHIFT+TAB indent or
un-indent selected lines
  • Hold ALT key down to select columns
  • Jeff Henshaw, borrowed of MFC PDC slide, 6/25/95

    NOTE: Not all of these work in VC++ 1.5x, most do in 2.x and 4.x

    15.5.5. How do I speed up VC++ compiles?

    Use precompiled headers, turn off the browser (Options:Project:Compiler:Listing Files:Browser Information), increase and/or decrease the size of your disk cache, tinker with the INCLUDE and LIB environment variable directory orders. That's about it.

    [email protected], programmer.tools, 8/19/95

    15.5.6. Make all MFC keywords a different color!

    Download the file USERTYPE.DAT from the FAQ Archive (See 2.2.6) and follow the directions in there. Try it, you'll like it!

    NOTE: This has been updated for 4.0

    [email protected], 8/31/95

    15.5.7. Easy way to launch 4.x projects without mdp files.

    For very large projects you might not bank or put mdp files into the version control system. You just want to grab the makefile and go. The problem is that Visual C++ does not easily recognize .mak files. Here's an easy way to launch right from a makefile to VC4.0 and have a .mdp file created.

    1. Bring up the registry edit (registry.exe for Windows 95 and regedt32.exe for Window NT 3.51)
    2. Activate the HKEY_CLASSES_ROOT window
    3. Add a new key
    .mak
    1. Add a new string value
    mdpfile
    1. Close the registry

    That's it. Now you can just select any Visual C++ 4.0 makefile from the file manager or the explorer and the Visual C++ IDE will come up and a project workspace (.mdp) will be create for that makefile. You no longer have to go into the visual environment do a "file open", enter a filename, and select "open as...makefile". This is definitely a time saver.

    [email protected]