Click here to Skip to main content
14,207,985 members
Click here to Skip to main content
Add your own
alternative version

Stats

953.5K views
25.1K downloads
246 bookmarked
Posted 26 Sep 2002
Licenced

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

 
GeneralRe: PRECOMP_VC7_TOBEREMOVED symbols Pin
davelasker11-Dec-04 15:09
memberdavelasker11-Dec-04 15:09 
GeneralSmall bug Pin
Artur Lew11-Nov-03 23:48
sussArtur Lew11-Nov-03 23:48 
GeneralCustomized built step Pin
delta cusp29-Oct-03 2:57
memberdelta cusp29-Oct-03 2:57 
GeneralBug with double quotes Pin
ed welch27-Oct-03 5:37
membered welch27-Oct-03 5:37 
GeneralRe: Bug with double quotes Pin
19-Apr-04 8:23
suss19-Apr-04 8:23 
GeneralNifty tool Pin
Aleksandar Jovanovic26-Oct-03 22:39
memberAleksandar Jovanovic26-Oct-03 22:39 
GeneralGreetings Pin
Zhefu Zhang24-Oct-03 14:59
memberZhefu Zhang24-Oct-03 14:59 
GeneralRe: Greetings Pin
Stephane Rodriguez.24-Oct-03 22:17
memberStephane Rodriguez.24-Oct-03 22:17 
Thanks for the feedback.

LongSleeves is a consequence from being bored of the many things that led me for instance to write the "Save as html" hook. After years of reusing the IE browser and trying (without much success) to build applications in a consistent way, I have decided I had enough of relying on that engine.
So LongSleeves 1.0 is meant to be a web browser.

Don't be mistaken though, LongSleeves != web browser, as I am interested in both coming up with versatile stuff at the low level, and coming up with versatile stuff at the application level. To make things short, I want to change the GDI code that LongSleeves relies on as of date, with more savvy-oriented assembler computer-graphics algorithms (my background), and/or DirectX, and/or the LH API, and/or whatever might hold.
I also want to make the LongSleeves API useable in a much more broad manner. For instance, at the application level, one could write an Excel-like application with all the benefits of an html rendering engine.
etc.

But I wnat things to be designed the right way. That's why on one hand this project is low priority and is behind 3 shorter term projects (subscribe my RSS feed if you want to know more). On the other hand, I am caught with subscription models in my design. It's great to spend time on this instead of just pissing code.

Don't forget to subscribe the RSS feed by the way.

[edit]And now that I see the amazing things you are doing, I really think guys from the Internet Explorer team or even the Windows team should be thrown on their face articles like yours, only to show them what developers have to do to really use the APIs.[/edit]




  RSS feed
GeneralRe: Greetings Pin
melwyn29-Oct-03 21:23
membermelwyn29-Oct-03 21:23 
GeneralRe: Greetings Pin
Stephane Rodriguez.2-Nov-03 8:52
memberStephane Rodriguez.2-Nov-03 8:52 
GeneralRe: Greetings Pin
melwyn2-Nov-03 20:14
membermelwyn2-Nov-03 20:14 
GeneralRe: Greetings Pin
Stephane Rodriguez.3-Nov-03 8:13
memberStephane Rodriguez.3-Nov-03 8:13 
GeneralRe: Greetings Pin
melwyn3-Nov-03 22:05
membermelwyn3-Nov-03 22:05 
General/tlb issue Pin
nospamnerd23-Oct-03 9:41
membernospamnerd23-Oct-03 9:41 
GeneralRe: /tlb issue Pin
Stephane Rodriguez.24-Oct-03 22:10
memberStephane Rodriguez.24-Oct-03 22:10 
GeneralRe: /tlb issue Pin
nospamnerd27-Oct-03 4:25
membernospamnerd27-Oct-03 4:25 
GeneralRe: /tlb issue Pin
Stephane Rodriguez.27-Oct-03 4:52
memberStephane Rodriguez.27-Oct-03 4:52 
GeneralRe: /tlb issue Pin
nospamnerd3-Nov-03 2:33
membernospamnerd3-Nov-03 2:33 
GeneralIdeal for when your crap code doesn't compile under the new compiler!!! Pin
Anonymous23-Oct-03 4:22
memberAnonymous23-Oct-03 4:22 
GeneralRe: Ideal for when your crap code doesn't compile under the new compiler!!! Pin
NormDroid23-Oct-03 6:07
professionalNormDroid23-Oct-03 6:07 
GeneralRe: Ideal for when your crap code doesn't compile under the new compiler!!! Pin
Stephane Rodriguez.23-Oct-03 6:24
memberStephane Rodriguez.23-Oct-03 6:24 
GeneralRe: Ideal for when your crap code doesn't compile under the new compiler!!! Pin
nospamnerd23-Oct-03 7:36
membernospamnerd23-Oct-03 7:36 
GeneralOctober 23, 2003 update Pin
Stephane Rodriguez.23-Oct-03 1:48
memberStephane Rodriguez.23-Oct-03 1:48 
GeneralRe: October 23, 2003 update Pin
Darren Schroeder5-Nov-03 7:50
memberDarren Schroeder5-Nov-03 7:50 
GeneralRe: October 23, 2003 update Pin
Stephane Rodriguez.5-Nov-03 8:05
memberStephane Rodriguez.5-Nov-03 8:05 

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.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web05 | 2.8.190612.1 | Last Updated 23 Oct 2003
Article Copyright 2002 by Stephane Rodriguez.
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid