What is this ?

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.

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.

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.

hi ,
I am working Visual C++6 Platform .I want to convert VC7 Project to VC6.I try to used your Binary exe.But I can not open it.When I open it ,the prjconverter.exe window closed with in a second. Why like this?.Do I neeed to do any settings? Help me please...

hey this is a very nice tool to use thanks for sharing it, thumbs up, anyway i had this question sometimes i download source codes for c#.net but it gives me an error when i open the project file and said it was written in a higher version and cant open it, can you help me with it please, am using .NET 2002

A question? What question? You're talking about C# projects and I guess that you meant how C# .NET 2003 projects are supported or not in VS.NET 2002 if I elaborate the question correctly. Why is this question asked here, below a C++ oriented article, and not in the appropriate C# forum?
Not even that, I think you don't seem to know that Google can answer those questions for the lazy uneducated bunch out there who won't read the product release notes. Here is a hint, type "C# 2003 2002" in Google.

Sorry mate, I am in the mood of making fun of you. That's so much a caricature.

I just wanted to say thank-you for a great tool. I'm completely new to VC++6 so I've been downloading lots of examples and this tool helped me alot when I found VC++7 examples.

I made a little reg file to compliment it's use (explanation in the file ), not sure if there's something like this already, but I thought I would share anyway because it helps me, and hopefully someone else will like it too?

Once again.. Thank-you!!

// ----------------------------------------------------
// Create a new file called RegPRJC.reg or anything.reg
// Paste the code below, then double click on the file.
// ----------------------------------------------------

REGEDIT4<br />
<br />
; FileName :: RegPRJC.reg<br />
; Created :: 2004/02/27 by PB<br />
; Disclaimer :: USE AT YOUR OWN RISK.<br />
;<br />
; I found a great little utility to convert VC++7 project<br />
; files to VC++6 project files. However, I couldn't get it<br />
; to work from the command prompt, probably due to bad<br />
; typing skills or not fully understanding how to type in<br />
; the path? I dunno, I'm new to all this VC++ stuff, so in<br />
; hopes to get it to work and to make life easier, I made<br />
; this little reg file to simply add a command to the<br />
; explorer menus when you right click on any ".sln" or<br />
; ".vcproj" file you want to convert. Works really great<br />
; and no typing required :)<br />
;<br />
; Download "prjconverter" by Stephane Rodriguez<br />
; http://www.codeproject.com/tools/prjconverter.asp -or-<br />
; http://www.arstdesign.com/articles/prjconverter.html<br />
<br />
[HKEY_CLASSES_ROOT\.sln]<br />
@="slnfile"<br />
[HKEY_CLASSES_ROOT\.vcproj]<br />
@="vcprojfile"<br />
[HKEY_CLASSES_ROOT\slnfile\shell\Convert SLN to VC6-DSW\command]<br />
@="prjconverter \"%L\""<br />
[HKEY_CLASSES_ROOT\vcprojfile\shell\Convert VCPROJ to VC6-DSP\command]<br />
@="prjconverter \"%L\""<br />
<br />
; Hope you Enjoy this little helper!

Hi
I'm using VS NET 2003 and allowing it to convert my VC6 projects. Sometimes I go back to using VC6 which "seems" to work ok and then back to VS NET 2003. Neither of them bitch and the code "seems" to run ok.