Click here to Skip to main content
15,896,111 members
Articles / Programming Languages / C++

VC++7 to VC++6 Project Converter

Rate me:
Please Sign up or sign in to vote.
4.92/5 (204 votes)
22 Oct 20033 min read 1.1M   25.6K   247  
Automatically convert Visual C++ 7.0 projects back to Visual C++ 6.0 projects.
This tool automatically converts VC++7 projects back to VC++6 projects. Without this tool, you end up recreating your projects from scratch, which is a total waste of time, and prone to errors. In this post, you will find a list of scenarios where this tool is useful. You will also find out how to use it, what is converted and technical details.
#pragma once

/////////////////////////////////////////////////////////////////////////////////
//
// vcprojprocess class
//
// S.Rodriguez - Sept 2002
//
//
// purpose : convert a .vcproj file format to a .dsp file format
//           (a .vcproj file is the makefile of a VisualStudio 7 C++ project)
//
//






class vcprojprocess
{

	// Members
protected:
	CString				m_szSolutionName; // .sln fully qualified filename
	PROJECTPARAM*		m_cpPrj; // copy ptr (no need to destroy)
	
	CFile				m_inputFile; // to read the .vcproj file
	CFile				m_outputFile; // to write the .dsp file

	// extracted from the .vcproj file
	CString				m_szProjname;
	CString				m_szTargetType;
	BOOL				m_bIsConsoleApp;
	CString				m_szSccProjectName; // source control
	CString				m_szSccLocalPath;
	ArrayCString		m_arrConfigurationNames;
	ConfigurationArray	m_arrConfigs;


	// Constructor
public:
	vcprojprocess();
	~vcprojprocess();

	// Methods
public:
	void process(CString &szSolutionName, PROJECTPARAM *p);
	void getSourceControlInfo(CString &szSccName, CString &szSccPath);


	// Helpers
protected:
	void extractHeader(IXMLDOMDocument *pDoc);
	void extractConfigurations(IXMLDOMDocument *pDoc);
	void extractFileConfigurations(IXMLDOMElement *pFileElement, ConfigurationArray &arrFileConfigs);

	void writeDspHeader();
	void writeDspConfigurations(IXMLDOMDocument *pDoc);
	void writeDspMakefile(long i);
	void writeDspFiles(IXMLDOMDocument *pDoc);
	void writeDspGroup(IXMLDOMElement *pGroupFilter);
	void writeDspFileConfigurations(CString &szFilename, ConfigurationArray &arrFileConfigs, ConfigurationArray &projectConfigs);
	void writeDspFooter();

	BOOL isFullPath(CString &szFilepath);
	void getAttribValue(/*in*/IXMLDOMElement *p,/*in*/char *szAttribName, /*out*/CString &szValue);
	void getNodeName(/*in*/IXMLDOMElement *p, /*out*/CString &szName);
	void VARIANT_to_CString(/*in*/VARIANT &vt, /*out*/CString &s);
	void BSTR_to_CString(/*in*/BSTR bstr, /*out*/CString &s);
	CString TranslateConfigurationName(CString &sInputConfigName);
	CString ExtractPlatform(CString &sInputConfigName);
	void TokenizeString(/*in*/CString &szInput, char cToken, /*out*/ArrayCString &arrStrings);
	void UntokenizeString(/*in*/ArrayCString &arrStrings, char cToken, /*out*/CString &szOutput);
};

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.


Written By
France France
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