一、在VS2010中打开VS2012的项目
VS2012中对C#的支持度非常好,不管是编写方便程度(不需要插件就能高亮代码及代码自动提示功能),还对MFC的一些功能优化很多。
我们可以修改两个工程文件来把VS2012的工程文件一直到VS2010中去。
首先当然是修改解决方案文件(.sln文件)。
使用记事本打开,把里面的
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
改成
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
然后修改工程文件(.vcxproj文件)
使用记事本打开,把两个带有v110标签的语句删了,
<PlatformToolset>v110</PlatformToolset>
现在就可以了。
只修改第一个可以移植到VS2010中,但是无法编译,只有修改了第二个工程文件才可以。
现在就可以在VS2012这个优秀的IDE上面写程序,最后通过上述方法移植到VS2010上去了。
参考1:http://www.cnblogs.com/lichen396116416/archive/2012/11/22/2782482.html
参考2 :http://www.cnblogs.com/johnsony/p/Version2012To2010.html
二、vs2005转换成2010
VS2005转换成VS2010时出现的问题:
This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended
解决方法:打开stdafx.h文件修改如下:
注释掉:
//#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
//#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
//#endif
//
//#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
//#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
//#endif
//
//#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
//#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
//#endif
//
//#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
//#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
//#endif
新增加:
#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0501 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0601 // Change this to the appropriate value to target IE 5.0 or later.
#endif
参考:http://blog.csdn.net/u013947807/article/details/53491598