Click here to Skip to main content
11,711,750 members (79,349 online)
Click here to Skip to main content
Add your own
alternative version

VC++7 to VC++6 project converter

, 22 Oct 2003 784.3K 24.3K 246
This tool automatically converts Visual C++ 7.0 projects back to Visual C++ 6.0 projects.
prjconverter.zip
prjconverter.exe
prjconverter_demo.zip
prjconverter.exe
prjconverter_src.zip
prjconverter.dsp
prjconverter.dsw
// 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.Right(strlen(".sln")).CompareNoCase(".sln"))
		szSolutionName += ".sln";

	HANDLE hFind;
	WIN32_FIND_DATA fd;

	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;
	}

	::FindClose(hFind);


	slnprocess p;

	// *.sln passed in the cmdline
	if ( szSolutionName.Right(strlen(".sln")).CompareNoCase(".sln") )
	{
		p.process(szSolutionName);
	}
	else if ( szSolutionName.Right(strlen(".vcproj")).CompareNoCase(".vcproj") ) // *.vcproj passed in the cmdline
	{
		p.processProjectOnly(szSolutionName); // szSolutionName is not a *.sln name
	}
	else
	{
		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.

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.


You may also be interested in...

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