经常遇上这样的郁闷的事,除非再建个工程把文件都加进来,否则没别的办法。。。OOO,oh,NO
今天在老外的网站上找到一个小工具 testConvert.exe, 能把VC2005的工程转换为VC2003,实在是爽,而且还给了源码。。哈哈 http://dl2.youkuaiyun.com/down4/20070718/18143940621.zip
举个例子
D:/dx9/ 目录下 有 xxx.vcproj,是VC2005生成的
进入cmd控制台,
testConvert d:/dx9/***.vcproj
ok,就行了。
// code
#include "stdafx.h"
#include <atlrx.h>
#include <string>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])

...{

if(2 != argc)...{
cout << " usage : theExe <file>" << endl;
return -1;
}

//read file to memory
string strProject = argv[1];
FILE* fp = NULL;

if(NULL == (fp = fopen(strProject.c_str(), "r")))...{
cout << " cannot find the project" << endl;
return -1;
}

string strText;


while(!feof(fp))...{
strText += fgetc(fp);
}

fclose(fp);

//replace it
CAtlRegExp<> oRegExp;
oRegExp.Parse("Version="[7-9].[0-9]0"");

CAtlREMatchContext<> oMatchContext;
if (!oRegExp.Match(strText.c_str(), &oMatchContext))

...{
cout << " invalidate format" << endl;
return -1;
}

string strNewText = strText.substr(0, strText.size() - lstrlen(oMatchContext.m_Match.szStart)) + "Version="7.00"" +
strText.substr(strText.size() - lstrlen(oMatchContext.m_Match.szEnd), -1);
//backup
string strBackProject = strProject + "_old";
CopyFile(strProject.c_str(), strBackProject.c_str(),FALSE);
//dump it to disk

if(NULL == (fp = fopen(strProject.c_str(), "r+")))...{
cout << " cannot find the project" << endl;
return -1;
}

fwrite(strNewText.c_str(),1,strNewText.size() - 1, fp);

fclose(fp);

return 0;
}