当我遵循以下命令时,我遇到了一个奇怪的编译错误MSDN文档 http://msdn.microsoft.com/en-us/library/87zae4a3(VS.80).aspx在 Visual Studio 2005 中使用 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;
}
编译错误:错误C3861:'AtlThrowLastWin32':找不到标识符
我不知道这怎么会发生。这AtlThrowLastWin32 的文档 http://msdn.microsoft.com/en-us/library/y3a80dsf.aspx显示需要atldef.h,但是我在atldef.h中找不到AtlThrowLastWin32的声明。
我最终通过添加 2 个包含标头解决了这个问题:
#include <atlbase.h>
#include <atlstr.h>
我不知道为什么MSDN文档没有提到这一点。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)