Click here to Skip to main content
Click here to Skip to main content
Go to top

VC++7 to VC++6 project converter

, 22 Oct 2003
Rate this:
Please Sign up or sign in to vote.
This tool automatically converts Visual C++ 7.0 projects back to Visual C++ 6.0 projects.

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

  • Sept 27 - code complete
  • Oct 2 - 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.
  • Oct 30 - 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).
  • Nov 13 - 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

Share

About the Author

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

 
GeneralMy vote of 5 PinmemberEcurve11-Mar-12 23:12 
Generalthank you x100 PinmemberMember 785965820-Apr-11 11:12 
QuestionTrouble with configuration file PinmemberClement Ehrenreich27-Jan-10 14:11 
GeneralSource Updates PinmemberHibn22-Apr-09 4:27 
GeneralRe: Source Updates PinmemberStephane Rodriguez.29-Apr-09 4:53 
GeneralRe: Source Updates Pinmembersfenu28-Jun-09 12:08 
GeneralRe: Source Updates PinmemberHibn19-Jul-09 16:14 
GeneralRe: Source Updates Pinmembersfenu20-Jul-09 0:36 
GeneralThis one is really nice utility PinmemberHansaP13-Feb-09 0:18 
Questionwhat about $(InputName) and $(ConfigurationName) project variables ? Pinmemberzain123417-Dec-08 8:10 
GeneralThank you for the binary Pinmembertemp_trash12345-Nov-08 3:59 
JokeYou are god PinmemberMember 103634522-Apr-08 2:01 
GeneralThis one I've been waiting for!!! Pinmember Sarath. 9-Jan-08 17:48 
QuestionHave you tried this with VS 2008?? PinmemberJediScientist18-Nov-07 7:36 
AnswerRe: Have you tried this with VS 2008?? Pinmemberkeran9-Dec-08 4:36 
GeneralLink Error- Kindly help! PinmemberPriya_Sundar2-Oct-07 20:34 
Questionconvert .mak settings to .dsp .dws settings [modified] Pinmemberhackeronte de bugger26-Aug-07 5:44 
Generaldoesnt work with just a .vcproj file Pinmemberpblais30-Apr-07 10:12 
GeneralRe: doesnt work with just a .vcproj file PinmemberMajorCode4-Sep-07 6:26 
I had success by placing the .vcproj file into the same directory as the prjconverter.exe I did not investigate the source code, but for whatever reason, the command line did not like a fully qualified path.
 
MCM
GeneralRe: doesnt work with just a .vcproj file PinmemberMulleDK1315-Oct-07 5:49 
GeneralDoesn't work for larger projects Pinmemberphm3712-Mar-07 23:01 
GeneralI get this error in all the cases Pinmembershravankrshukla16-Feb-07 0:10 
GeneralExactly what I needed. Great tool, thanks a lot! Pinmemberwef iwefkgw wefwjhg wef3-Feb-07 4:46 
GeneralExcellent utility... Pinmemberravisetti11-Dec-06 12:58 
Generalcompile error Pinmemberzoz11-Dec-06 11:30 
GeneralRe: compile error PinmemberStephane Rodriguez.12-Dec-06 9:48 
Generalneed to convert manually $ProjectName Pinmemberot_av29-Nov-06 0:24 
Generalsmall bug Pinmemberincucuna17-Sep-06 21:11 
Generalerror compiling under VC++ 7 Pinmemberrb-x7-Aug-06 16:36 
GeneralRe: error compiling under VC++ 7 PinmemberStephane Rodriguez.17-Aug-06 19:50 
AnswerRe: error compiling under VC++ 7 Pinmembercpetig30-Mar-07 5:30 
GeneralFails to convert include paths with environment variables Pinmembertomasth17-May-06 1:54 
GeneralRe: Fails to convert include paths with environment variables PinmemberStephane Rodriguez.17-Aug-06 20:17 
GeneralIt would be good to have a VC++8 to VC++7 too... PinmemberJun Du26-Apr-06 6:03 
GeneralRe: It would be good to have a VC++8 to VC++7 too... [modified] PinmemberStephane Rodriguez.17-Aug-06 20:18 
GeneralRe: It would be good to have a VC++8 to VC++7 too... Pinmemberpipomolo11-Oct-06 3:09 
QuestionSuper. Could it also generate vc7.x nmake file? Pinmemberl_d_allan21-Apr-06 2:49 
GeneralTerrific. But 'run-together' compiler flags generated. Pinmemberl_d_allan21-Apr-06 2:44 
GeneralRemarakable Work!!! Pinmembervatic1-Feb-06 10:30 
Generalexcellent!!! thanks a lot Pinmemberfabrizio.carraro21-Jan-06 9:45 
GeneralSome error msg in VC++ 6 Pinmemberjasonliang28-Dec-05 19:49 
GeneralRe: Some error msg in VC++ 6 PinmemberMrJOeM21-Nov-06 7:25 
GeneralWonderful job PinmemberMRAAX23-Dec-05 21:53 
Generalhelp ,wont detect the .sln Pinmemberdirk>uk24-Nov-05 10:52 
QuestionIE SaveAs MHTML Pinmemberpluplu20021-Nov-05 6:56 
GeneralGenerate makefile from VC 6 PinmemberIrvin Tan8-Nov-05 22:01 
GeneralRe: Generate makefile from VC 6 PinmemberStephane Rodriguez.9-Nov-05 5:43 
GeneralExcellent but fails in one case PinmemberPierre Couderc8-Nov-05 21:19 
GeneralRe: Excellent but fails in one case PinmemberStephane Rodriguez.9-Nov-05 5:50 
GeneralRe: Excellent but fails in one case PinmemberPierre Couderc9-Nov-05 19:07 

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

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

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 23 Oct 2003
Article Copyright 2002 by Stephane Rodriguez.
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid