<< up a level

Microsoft Visual Studio 6.0

This page is here as a resource for people who use Microsoft Visual Studio 6. (or MSVC 6.0). Specifically, the C++ development environment portion.

Things to Install

WTL .. it is currently at 7.x, it is an open-sourced Microsoft framework of great C++ template/wrappers around Win32 (in the same spirit of the ATL)

C++ Boost .. great C++ libs which will hopefully become part of the C++ standard

WndTabs .. nice Add-On (more below)

Visual Assist - fantastic Add-On, basically Intellisense++ (more below)

Perforce - if you use Perforce, they have a good source control add-in (I like Perforce, so I recommend this)

DbgChooser - Code for an app that lets you choose the action windows takes when an application crashes (July 2000 MSDN Magazine article by John Robbins)

Visual C++ Toolkit 2003

Microsoft released the following Visual C++ Toolkit 2003 for free. I need to see how well it works with Visual Studio on another machine. I have used this on the same machine with Visual Studio installed, and it works fine. I used it to build a copy of Mozilla Thunderbird.

Knowledge Base Articles / MSDN

KB 154753 - Article on the C/C++ libraries linked to by the various versions of Visual C throughout the years

Major Changes in C++ Releases

Visual Studio Debugger Cheat Sheet

These are some pseudo-variables you can use in Visual Studio 6.0
@err			- The last error
@err,hr			- The ',hr' does an HRESULT interpretation
DW(@tib+0x24),x		- The current threads ID

Another site with some good Visual Studio tips.

Precompiled Headers

If you have been baffled by the Precompiled Headers feature and you want to cut down your compile times signifcantly, then read this article. It is well written and will get you using that stdafx.h properly.

Looking at EXE or DLL resources

One little known feature of Visual Studio 6 is the ability to open a file just for its resources. Just go to File->Open. Then choose the EXE/DLL and change the "Open As:" at the bottom to "Resource". Personally, I spent a bunch of time before this looking for apps that would do this for me. It wasn't till another person at work did this that I saw this. (Yeah, I should have read the manual :-). This other person read about it somewhere and also worked on the Visual Studio 2003 dev team. So, it wasn't just me!

Modifying the .RC file and Keeping your changes

Microsoft Support has a good knowledge base article on this issue tailored for modifying the VERSIONINFO block.
Note, since my project wasn't MFC, and I didn't have an .rc2 file, I had to make one. Then I just included them in View->Resource Includes as Compile time directives. There is almost no documentation on this. Here are two more good links on the topic.
Google Groups Post (Thanks Vagif!) and
MSDN Article

Using a Group Box in a Dialog?

If so, better make sure those WS_CLIPCHILDREN, WS_CLIPSIBLINGS is off. A Group Box will not erase it's background and requires its parent window to do that.

Awesome Visual Studio Add-Ons

WndTabs - this is a GREAT, FREE, add-on that puts a little tab view in the workspace. This makes it easy to click around quickly to different files. It also adds some new commands that you can bind keys to. My favorite is the 'Header Flip'. I mapped the CTRL-~ sequence to this new command. Now, if I'm in About.cpp, I can just hit that sequence and POW, I'm in About.h. Note, the WndTabs header flip is not as good as the one in the next Add-In I mention below.

Visual Assist - this is an absolutely great add-on. It costs money, but it is so good and they have a free trial. The three main features that is provides are: Really Improved/Fantastic completion, Really improved syntax coloring, and the ability to click on a method and then go to the definition of that method via a listbox selector in the toolbar. Nice! ALSO, VisualAssist has a header flip command as well, in fact, it will search in the entire Workspace for the file. Very Nice!

GRETA - Nice Regex Lib for Visual C++

Update - this was written in 2003. If you aren't using the Boost regex or PCRE, I would still consider this library. It works well.

GRETA - this is a GREAT, FREE, library / C++ template system for doing Perl 5 regular expressions (regex). It was done by a nice fellow named Eric Niebler while he was at Microsoft.

There are three things to keep in mind while using it. First, there is a separate one for commercial/free use here at GotDotNet. It's in the PowerTools zip file. Second, you will need to tweak the files (as shown below) for Visual Studio 6.0. Third, I have found the quality of this lib to be very high, if your regex isn't matching, it is probably your bug, not GRETA's

Here is how I built it in Visual Studio 6.0. First, I downloaded the package into a directory called C:\Greta. Then I created a new Win32 Static Library project (and Workspace) called Greta with it's location as C:\Greta. I didn't enable pre-compiled headers or MFC (of course). After that is done, just add the files to the Source Files folder for the project.

The next thing to do (for Visual Studio 6.0) is to move the REGEX_RESET_STK_OFLW() macro definition. The _resetstkoflw() function is only available for visual studio 7.0. The syntax2.h file should look like this.
#ifdef _MSC_VER
# include 
# define REGEX_ASSERT(x)        _ASSERTE(x)
# define REGEX_FORCEINLINE      __forceinline
# define REGEX_SELECTANY        __declspec(selectany)
# define REGEX_CDECL            __cdecl
# define REGEX_SEH_TRY          __try
# define REGEX_SEH_EXCEPT(x)    __except( x )
# if 1200 < _MSC_VER
# define REGEX_RESET_STK_OFLW() _resetstkoflw()
# define REGEX_NOINLINE         __declspec(noinline)
# define REGEX_DEPRECATED       __declspec(deprecated)
# else
# define REGEX_RESET_STK_OFLW() ((void)0)
# endif

You can now compile or build the library. The debug build will emit a lot of warnings (C4786) which are exptected from Visual Studio 6.0.

Interesting Google Groups Thread on VC 6.0 Optimizer

manfreds Access Violation with O2

int 3 for a breakpoint