5,779,527 members and growing! (135 online)
Email Password   helpLost your password?
Web Development » Applications & Tools » Tools with source code     Intermediate

VC++7 to VC++6 project converter

By Stephane Rodriguez.

This tool automatically converts Visual C++ 7.0 projects back to Visual C++ 6.0 projects.
VC6, VC7, C++Windows, Win2K, WinXPVS.NET2002, VS6, Visual Studio, Dev

Posted: 26 Sep 2002
Updated: 22 Oct 2003
Views: 388,987
Bookmarked: 206 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
230 votes for this Article.
Popularity: 11.23 Rating: 4.75 out of 5
6 votes, 3.1%
1
2 votes, 1.0%
2
2 votes, 1.0%
3
16 votes, 8.2%
4
169 votes, 86.7%
5

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

About the Author

Stephane Rodriguez.


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.


Location: France France

Other popular Applications & Tools articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 250 (Total in Forum: 250) (Refresh)FirstPrevNext
Generalwhat about $(InputName) and $(ConfigurationName) project variables ?memberzain12349:10 17 Dec '08  
GeneralThank you for the binarymembertemp_trash12344:59 5 Nov '08  
JokeYou are godmemberMember 10363453:01 22 Apr '08  
GeneralThis one I've been waiting for!!!member Sarath. 18:48 9 Jan '08  
GeneralHave you tried this with VS 2008??memberJediScientist8:36 18 Nov '07  
GeneralRe: Have you tried this with VS 2008??memberkeran5:36 9 Dec '08  
GeneralLink Error- Kindly help!memberPriya_Sundar21:34 2 Oct '07  
Questionconvert .mak settings to .dsp .dws settings [modified]memberhackeronte de bugger6:44 26 Aug '07  
Generaldoesnt work with just a .vcproj filememberpblais11:12 30 Apr '07  
GeneralRe: doesnt work with just a .vcproj filememberMajorCode7:26 4 Sep '07  
GeneralRe: doesnt work with just a .vcproj filememberMulleDK136:49 15 Oct '07  
GeneralDoesn't work for larger projectsmemberphm370:01 13 Mar '07  
GeneralI get this error in all the casesmembershravankrshukla1:10 16 Feb '07  
GeneralExactly what I needed. Great tool, thanks a lot!memberwef iwefkgw wefwjhg wef5:46 3 Feb '07  
GeneralExcellent utility...memberravisetti13:58 11 Dec '06  
Generalcompile errormemberzoz12:30 11 Dec '06  
GeneralRe: compile errormemberStephane Rodriguez.10:48 12 Dec '06  
Generalneed to convert manually $ProjectNamememberot_av1:24 29 Nov '06  
Generalsmall bugmemberincucuna22:11 17 Sep '06  
Generalerror compiling under VC++ 7memberrb-x17:36 7 Aug '06  
GeneralRe: error compiling under VC++ 7memberStephane Rodriguez.20:50 17 Aug '06  
AnswerRe: error compiling under VC++ 7membercpetig6:30 30 Mar '07  
GeneralFails to convert include paths with environment variablesmembertomasth2:54 17 May '06  
GeneralRe: Fails to convert include paths with environment variablesmemberStephane Rodriguez.21:17 17 Aug '06  
GeneralIt would be good to have a VC++8 to VC++7 too...memberJun Du7:03 26 Apr '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 22 Oct 2003
Editor: Smitha Vijayan
Copyright 2002 by Stephane Rodriguez.
Everything else Copyright © CodeProject, 1999-2009
Java | Advertise on the Code Project