C++ CA2W给了我一个“答案”';AtlThrowLastWin32';:“未找到标识符”;错误

C++ CA2W给了我一个“答案”';AtlThrowLastWin32';:“未找到标识符”;错误,c++,unicode,visual-studio-2005,atl,big5,C++,Unicode,Visual Studio 2005,Atl,Big5,当我在VisualStudio2005中使用CA2W将big5字符串转换为unicode字符串时,我遇到了一个奇怪的编译错误 这是我写的代码: #include <string> #include <atldef.h> #include <atlconv.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string chineseInBig5 = "\xA4\xA4\x

当我在VisualStudio2005中使用CA2W将big5字符串转换为unicode字符串时,我遇到了一个奇怪的编译错误

这是我写的代码:

#include <string>
#include <atldef.h>
#include <atlconv.h>

using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
    string chineseInBig5 = "\xA4\xA4\xA4\xE5";
    ATL::CA2W(chineseInBig5.c_str());
    return 0;
}
#包括

#include显示需要atldef.h,但我在atldef.h中找不到AtlThrowLastWin32的声明。

我最终通过添加2个include标头解决了此问题:

#include <atlbase.h> 
#include <atlstr.h> 
#包括
#包括

我不知道为什么MSDN文档没有提到这一点

MSDN(在您链接到的页面上)说:>需求>头文件:AtlBase.h,AtlConv.h(在AtlConv.h中声明),感谢Logan Capaldo。我终于明白了为什么我感到困惑。CA2AEX()的文档只提到“需求标题:atlconv.h”