Click here to Skip to main content
13,344,765 members (47,213 online)
Click here to Skip to main content


246 bookmarked
Posted 26 Sep 2002

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.
#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
	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

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

	// Helpers
	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.


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...

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