Visual Studio 2005的常见问题(一)!

来源:互联网 发布:证券模拟考试软件 编辑:程序博客网 时间:2024/05/23 01:02

1.       “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 “const char [3]”转换为“const wchar_t”

解决方法字符集问题,VC6工程默认是多字节的,VS2005默认是Unicode的。

如:Format ("%s",str);

修改为:Format (L"%s",str)Format (_T("%s"),str)就可以了。

 

2.       "无法从“const char [11]”转换为“ATL::CStringT<BaseType,StringTraits>”"

解决方法:先定义,另外赋值。

如:CString str = "模式对话框";

修改为:CString str;str = "模式对话框";CString str("模式对话框");就可以了啊。

原创粉丝点击