2009-07-05 173 views
4

当我跟着MSDN document使用CA2W改为big5字符串转换为Unicode字符串转换在Visual Studio中我有一个奇怪的编译错误,2005年CA2W给了我一个“‘AtlThrowLastWin32’:标识符找不到”错误

这是代码我写道:

#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; 
} 

的编译错误:错误C3861:“AtlThrowLastWin32”:标识符找不到

我不知道这是怎么发生。 document of AtlThrowLastWin32显示需要atldef.h,但我无法在atldef.h中找到AtlThrowLastWin32的声明。

回答

7

我最后加入解决了这个问题2包括头:

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

我不知道为什么MSDN文档没有提到。

+1

MSDN(你链接到页面上)说: >要求 >头文件AtlBase.h,AtlConv.h(在AtlConv.h声明) – 2009-07-05 13:30:51

相关问题