Click here to Skip to main content
15,883,883 members
Articles / Programming Languages / C++

VC++7 to VC++6 Project Converter

Rate me:
Please Sign up or sign in to vote.
4.92/5 (204 votes)
22 Oct 20033 min read 1.1M   25.6K   247   261
Automatically convert Visual C++ 7.0 projects back to Visual C++ 6.0 projects.
This tool automatically converts VC++7 projects back to VC++6 projects. Without this tool, you end up recreating your projects from scratch, which is a total waste of time, and prone to errors. In this post, you will find a list of scenarios where this tool is useful. You will also find out how to use it, what is converted and technical details.

Image 1

What Is This ?

This tool automatically converts Visual C++ 7.0 projects back to Visual C++ 6.0 projects. In other words, .sln/.vcproj file pairs are translated to .dsw/.dsp file pairs.

Important note, there is no loss during the conversion: source code is left unchanged; only .dsw/.dsp are created (or overwritten).

Why?

First of all, because MS doesn't provide it. It's easy to become cynical against MS when you feel how bad it is to sell developer tools without all the necessary "moulinettes" (converters in ugly English) to go backward.

Without this tool, you end up recreating your projects from scratch: a total waste of time, and prone to errors. Actually, there are several scenarios where this tool is useful:

  • Someone gives you a VC++ 7 project, and you only have VC++ 6 installed.
  • You have upgraded your project(s) from VC++ 6 to VC++ 7, and you have both .dsw/.dsp and .sln/.vcproj files on your local system drive, but you are willing to keep those files synchronized so any time you need to open the project, you need not bother the VC++ version you work with.
  • Provide both versions of projects (for instance, when you share code on CodeProject), so your audience does not need to bother with knowing which devtool is required.

How to Use It

The tool is a command line of the form:

prjconverter <solutionname (full filepath)>[.sln]

For instance:

prjconverter c:\tmp\betterxml\betterxml.sln

For info, type prjconverter.exe alone in the console.

What is Converted

A few steps to let you know how the work gets done. The .sln solution file is opened and translated to the .dsw file format, along with all project declarations, dependencies, and source control tags.

Then all .vcproj project files are translated to .dsp files. I use MSXML to parse the .vcproj file format, and build the meta-model out of it. Then what's left to do is serialize all those XML thingies into the standard .dsp symbol lines.

Of course, we care about project configurations (debug, release, ...), and custom file configuration settings.

Technical Details

In the code provided, slnprocess.cpp does the .sln =>.dsw conversion. vcprojprocess.cpp does the .vcproj => .dsp conversion. And vcprojconfiguration.cpp holds the project meta-model (all project setting tabs). In VC++ 7, the meta-model is now programmable. Let's check out this link. In fact, vcprojconfiguration.cpp reflects exactly this meta-model (as if it was internal MS code).

Disclaimer

This tool has been extensively tested before being published (MFC/COM/ATL/console apps, makefiles, ...). Though I am willing to know if there is anything I can do in order to improve it, let me clearly say that it's not my fault if your project is corrupted by this tool.

Update History

  • 27th September, 2002 - Code complete
  • 2nd October, 2002 - Now it is possible to convert .vcproj files alone (no need of a root .sln file): just type the .vcproj full path in the command line.
  • 30th October, 2002 - Improvements based on user feedback: added missing default link libraries, expanded certain macro variables such like $(OutDir) and $(IntDir), replaced or removed certain macro variables not supported by VC6 such like $(NoInherit), added /GX (exception handling enabled)
  • 13th November, 2002 - Bug fixes: filenames with spaces, MFC extension DLL support, custom precompiled header setting, project setting inheritance

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.

A list of licenses authors might use can be found here.


Written By
France France
Addicted to reverse engineering. At work, I am developing business intelligence software in a team of smart people (independent software vendor).

Need a fast Excel generation component? Try xlsgen.

Comments and Discussions

 
GeneralRe: Compile Fails with VC7.1 Pin
gthorne28-Jun-04 12:03
gthorne28-Jun-04 12:03 
GeneralRe: Compile Fails with VC7.1 Pin
BRG1-Jul-04 9:13
BRG1-Jul-04 9:13 
General&amp;#50556;&amp;#54620;&amp;#44144;~ &amp;#51600;&amp;#44048; &amp;#54616;&amp;#49464;&amp;#50836;. Pin
성혜리20-Jun-04 21:55
suss성혜리20-Jun-04 21:55 
General&amp;#50504;&amp;#45397;&amp;#54616;&amp;#49464;&amp;#50836;. Pin
복돌이15-Jun-04 0:52
suss복돌이15-Jun-04 0:52 
General&amp;#50504;&amp;#45397;&amp;#54616;&amp;#49464;&amp;#50836;. Pin
복순이12-Jun-04 8:08
suss복순이12-Jun-04 8:08 
GeneralRe: &amp;#50504;&amp;#45397;&amp;#54616;&amp;#49464;&amp;#50836;. Pin
Stephane Rodriguez.13-Jun-04 5:00
Stephane Rodriguez.13-Jun-04 5:00 
GeneralVCPROJ to dsp Pin
shreyash7-Jun-04 19:18
shreyash7-Jun-04 19:18 
GeneralRe: VCPROJ to dsp Pin
Stephane Rodriguez.8-Jun-04 4:00
Stephane Rodriguez.8-Jun-04 4:00 
If you read the article, it tells quite clearly that you can conver tthe .vcproj project by passing the filepath just like you would with a .sln file.


GeneralAnother 'thank you' Pin
D. Smith2-Jun-04 6:07
D. Smith2-Jun-04 6:07 
Generalthank you Pin
araud27-May-04 3:16
araud27-May-04 3:16 
QuestionWhy exe not working? Pin
pubududilena21-May-04 18:55
pubududilena21-May-04 18:55 
AnswerRe: Why exe not working? Pin
Stephane Rodriguez.21-May-04 18:59
Stephane Rodriguez.21-May-04 18:59 
GeneralImportant Question Pin
asdf5007-May-04 20:34
asdf5007-May-04 20:34 
GeneralRe: Important Question Pin
Stephane Rodriguez.8-May-04 7:17
Stephane Rodriguez.8-May-04 7:17 
GeneralRe: Important Question Pin
Anonymous8-May-04 7:47
Anonymous8-May-04 7:47 
GeneralRe: Important Question Pin
Stephane Rodriguez.8-May-04 10:08
Stephane Rodriguez.8-May-04 10:08 
GeneralCharacterSet / UNICODE translation Pin
Steve Elliott27-Apr-04 15:06
Steve Elliott27-Apr-04 15:06 
GeneralProject to Make file Pin
MoBorujeni9-Mar-04 11:08
MoBorujeni9-Mar-04 11:08 
GeneralRe: Project to Make file Pin
Stephane Rodriguez.9-Apr-04 23:08
Stephane Rodriguez.9-Apr-04 23:08 
GeneralRe: Project to Make file Pin
Member 104501519-May-04 7:09
Member 104501519-May-04 7:09 
GeneralThank-you ... here is something extra to make it easier. Pin
mjeb111128-Feb-04 16:47
mjeb111128-Feb-04 16:47 
GeneralRe: Thank-you ... here is something extra to make it easier. Pin
Stephane Rodriguez.28-Feb-04 21:45
Stephane Rodriguez.28-Feb-04 21:45 
GeneralRe: Thank-you ... here is something extra to make it easier. Pin
Blue_Aqua1-Apr-04 18:50
Blue_Aqua1-Apr-04 18:50 
Questioncan't download the binaries ? Pin
j_ant9417-Feb-04 14:54
j_ant9417-Feb-04 14:54 
AnswerRe: can't download the binaries ? Pin
Stephane Rodriguez.17-Feb-04 19:42
Stephane Rodriguez.17-Feb-04 19:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.