Click here to Skip to main content
12,556,918 members (52,792 online)
Click here to Skip to main content


245 bookmarked

VC++7 to VC++6 project converter

, 22 Oct 2003
This tool automatically converts Visual C++ 7.0 projects back to Visual C++ 6.0 projects.
// prjconverter.cpp : Defines the entry point for the console application.

#include <stdio.h>
#include <windows.h>
#include "slnprocess.h"

int main(int argc, char* argv[])
	if (argc!=2)
		printf ("prjconverter : Converts a VC++7 project to a VC++6 project\n" \
			    ".sln/.vcproj pairs are converted to .dsw/.dsp pairs\n\n" \
				"Usage: prjconverter.exe <solutionname (full filepath)>[.sln]\n" \
				"Example: prjconverter c:\\tmp\\betterxml.sln\n\n\n" \
				"Codeproject, Stephane Rodriguez, Sept 22 2002.\n");
		return 0;

	// make sure the .sln (or .vcproj) file actually exists

	CString szSolutionName = argv[1];
	if (!szSolutionName.Right(strlen(".vcproj")).CompareNoCase(".vcproj") &&
		szSolutionName += ".sln";

	HANDLE hFind;

	if ((hFind=::FindFirstFile(szSolutionName,&fd))==INVALID_HANDLE_VALUE)
		printf ("%s does not exist.\n",szSolutionName);
		return 0;

	if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
		printf ("%s is a directory!\n",szSolutionName);
		return 0;


	slnprocess p;

	// *.sln passed in the cmdline
	if ( szSolutionName.Right(strlen(".sln")).CompareNoCase(".sln") )
	else if ( szSolutionName.Right(strlen(".vcproj")).CompareNoCase(".vcproj") ) // *.vcproj passed in the cmdline
		p.processProjectOnly(szSolutionName); // szSolutionName is not a *.sln name
		printf ("Only .sln and .vcproj filenames are processed.\n",szSolutionName);
		return 0;

	return 0;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


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

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.

You may also be interested in...

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