错误现象:
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h(112): error C3861: “InitializeCriticalSectionAndSpinCount”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(227): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(227): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(228): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(228): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(229): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(229): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(230): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(230): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(231): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(231): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(232): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(232): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(233): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(233): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(234): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(234): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(235): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(235): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(236): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(236): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(237): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(237): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(238): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(238): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(239): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(239): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(240): error C3861: “ActivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(240): error C3861: “DeactivateActCtx”: 找不到标识符
1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h(241): error C3861: “ActivateActCtx”: 找不到标识符
解决办法:
1. 在 StdAfx.h头文件中 添加 #include <SDKDDKVer.h> (位置:在 #include <afxwin.h> // MFC core and standard components,这句话前)
2.找到 宏定义 WINVER 将 0x0400 改为 0601,_WIN32_WINNT 将 0x0400改为0601。
如果是#define WINVER 0x0400 ,那就直接改为0x0601.( 0x0601是WIN7系统 ,本人的是VS2010,支持到WIN7就这样改了。)
如果是是在预处理定义的,就按下图操作。