Visual Studio 6.0 on Windows 7
After a long and impatient wait I finally laid my hands on my brand spanking new Dell Precision M6400 mobile workstation with a blazing fast 250 GB solid state hard drive. I ordered it with FreeDOS since I was not sure which operating system I wanted. I have been using Windows XP for many years now. Not because I am resistant to change, but because I develop software using Microsoft Visual C++ 6.0. At SYCODE we have a policy of supporting older versions of CAD systems to the extent that it is technically possible. For example, all our AutoCAD plug-ins work with AutoCAD 2000, which is a decade old. AutoCAD 2000 plug-ins need to be built using VC 6 which works perfectly fine on Windows XP but not on the new Windows 7, or so I had read.
While I believe Windows XP is a rugged OS it is quite old and I really wanted to move to Windows 7. So I went ahead and installed Windows 7 Ultimate on my mobile workstation and decided to figure out a way to get VC 6 up and running on it. By setting up the right compatibility options I managed to install Visual Studio 6.0 on Windows 7, but unfortunately getting VC 6 to run properly was another story. It crashed arbitrarily mostly as soon as I loaded a project. I tried all possible compatibility options, but the crashes didn’t go away. So I decided to do the next best thing – install XP Mode on Windows 7. I used these instructions to do that. I then installed VC 6 with SP6 on the Windows XP sitting within Windows 7 and all was well.
However, this Virtual PC on XP Mode solution comes at a price. I noticed the compilation and linking to be extremely slow, which defeats the very purpose for spending all that money for a solid state hard drive. So I decided to do some experimentation. I wanted to know what exactly did Windows 7 not like about VC 6. Was it the compiler, the linker, an add-in, the IDE or a million other things that depend on the IDE? To dig a little deeper I built a few of my VC 6 projects in Windows 7 from the command line by using /MAKE switch of MSDEV.EXE. None of the builds caused a crash. So it appeared that Windows 7 had absolutely no problem with VC 6 compiling and linking my projects. The crash occurred only when I used the VC 6 IDE. Which meant that if I wanted to only build my VC 6 projects I could do so directly in Windows 7, without having to jump through hoops and do it in Windows XP and waste a lot of time in the bargain.
For me, this was really exciting. Let me explain why by giving you a brief run down on how I set up my AutoCAD plug-ins. Every three years Autodesk changes AutoCAD significantly. Not only does it change the DWG file format, it also changes the compiler with which it builds AutoCAD itself. For AutoCAD 2000, 2004, 2007 and 2010 Autodesk used VC 6, 7, 8 and 9 respectively. Therefore AutoCAD plug-in developers like myself need to use the same compiler that Autodesk used to write a plug-in that a particular version of AutoCAD. Now, since the functionality of my plug-ins across all versions of AutoCAD are more or less the same, it made sense for me to use the same code stream across all versions of VC. So over the years I have adjusted my C++ code to take care of the new compilers as they came along. For example, for VC 8 I made my code UNICODE compliant. And as it turns out, I find myself using the VC 6 IDE lesser and lesser. I do most of my work in the IDE’s of VC 8 or 9 and use that of VC 6 to check if my code builds all right.
So as far as I am concerned I like this particular work around. When I want to create a new project in VC 6 or work with an existing one, I will go ahead and do it in XP Mode, otherwise I will simply continue to build my VC 6 projects directly in Windows 7 using the command line. Thought I’d share this with my brethren in the programming world. If any of you have a better solution or a work around, do let me know by leaving a comment.