注册 登录
编程论坛 VC.NET论坛

[求助]在visual studio 2005 中如何定义 _UNICODE ?? 求助

mscao 发布于 2006-03-29 23:20, 2617 次点击

在 visual studio 2005 中 没有像 vc.net 2003 中那样很好的支持 Unicode ,

将以前的项目导入到vc 2005 中,总出现 错误

error C2664: 'CWinApp::GetProfileIntW' : cannot convert parameter 1 from 'const char [12]' to 'LPCTSTR' e:\vc.net\visual studio 2005\projects\...\persist.cpp 108

error C2440: 'type cast' : cannot convert from 'CString' to 'const char *' e:\vc.net\visual studio 2005\projects\..\persist.cpp 98

error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)' : cannot convert parameter 1 from 'const char [20]' to 'const wchar_t *' e:\vc.net\visual studio 2005\projects\...\persist.cpp 71

等错误, 请问该如何很好的解决这个问题, 因为没有定义_UNCODE,则编译器产生的代码将使用普通8位ANSI,?? 我不知道该怎么定义 Unicode 宏??谢谢

1 回复
#2
mscao2006-03-31 12:56
我通过修改编译环境的字符集,已经解决,不知还有其他方法没有???
1