[solution] vc7 (.sln)-> vc6 (.dsw)

A forum to store posts deemed exceptionally wise and useful
Post Reply
Ayanami
Posts: 24
Joined: Wed Jan 14, 2004 1:30 pm

[solution] vc7 (.sln)-> vc6 (.dsw)

Post by Ayanami »

for example 9.Meshviewer have as project file .sln and not .dsw .. you can not load in vc6.

here the solution for you:

source: http://www.codeproject.com/tools/prjconverter.asp

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 itThe 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).
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Ah, cool. I forgot to create a VS 6 and a DevC++ project for this tutorial, sorry. But I'll add it with the next release :)
Aeolus

Post by Aeolus »

I cant sign up!!! :cry:
Could you send me the source code and the binaries?
Thank you very much!
E-mail: aeolus_41@163.com
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

thnx for the link Ayanami!

very interesting indeed. Haven't tried it out yet, but I've been in that situation needing to get a VC7 project back to VC6. I guess I'll have the chance to try it out soon.

thnx!
Image
Peter Müller
Posts: 292
Joined: Sun Mar 14, 2004 5:28 pm
Location: Germany
Contact:

Post by Peter Müller »

*bookmarking*
http://www.games-forge.de - Die Community für Nachwuchsprogrammierer
Post Reply