use*_*319 4 c++ unicode atl visual-studio-2005 big5
当我按照MSDN文档使用CA2W将big5字符串转换为Visual Studio 2005中的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;
}
Run Code Online (Sandbox Code Playgroud)
编译错误:错误C3861:'AtlThrowLastWin32':找不到标识符
我不知道这怎么可能发生.AtlThrowLastWin32的文档显示atldef.h是必需的,但我在atldef.h中找不到AtlThrowLastWin32的声明.
我终于通过添加2个包含头来解决了这个问题:
#include <atlbase.h>
#include <atlstr.h>
Run Code Online (Sandbox Code Playgroud)
我不知道为什么MSDN文档没有提到这一点.
| 归档时间: |
|
| 查看次数: |
1473 次 |
| 最近记录: |