vs2003 mfc项目转换为vs2010项目遇到的问题

时间:2021-08-23 00:38:05

出现错误:

1. 计算机未注册mscomm控件,解决方法见http://blog.csdn.net/chenyujing1234/article/details/7843052;


2.1>ClCompile:
1>  stdafx.cpp
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4024): error C2061: 语法错误: 标识符“PSCROLLBARINFO”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2065: “PSCROLLBARINFO”: 未声明的标识符
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2146: 语法错误: 缺少“)”(在标识符“pScrollInfo”的前面)
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2761: “BOOL CScrollBar::GetScrollBarInfo(void) const”: 不允许成员函数重新声明
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2059: 语法错误:“)”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(185): error C2143: 语法错误 : 缺少“;”(在“{”的前面)
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(185): error C2447: “{”: 缺少函数标题(是否是老式的形式表?)
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcmn3.inl(20): error C2065: “CCM_SETWINDOWTHEME”: 未声明的标识符
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcmn3.inl(23): error C2065: “CCM_SETWINDOWTHEME”: 未声明的标识符
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcmn3.inl(29): error C2065: “CCM_SETWINDOWTHEME”: 未声明的标识符
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcmn3.inl(46): error C2065: “CCM_SETWINDOWTHEME”: 未声明的标识符
解决方法:http://blog.csdn.net/cs_21cn/article/details/7925455

To fix this problem, make your stdafx.h file look like this:

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#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 0x0500 // Change this to the appropriate value to target IE 5.0 or later.
#endif

3.odbccp32.lib(dllload.obj) : error LNK2019: 无法解析的外部符号 __imp___vsnprintf,该符号在函数 _StringVPrintfWorkerA@20 中被引用


解决方法:从别的地方或者网络上下载这个库文件,放入VS安装目录里的VC\lib目录即可