大家好:
CString s;
int i = 64;
s.Format("%d", i);以上代码在运行的时候出现以下异常,
e:\uniargusvc\andytest\andytest\test.cpp(11) : error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [3]”转换为“const wchar_t *”
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换请问是什么原因呀!我该怎么修改!谢谢!
CString s;
int i = 64;
s.Format("%d", i);以上代码在运行的时候出现以下异常,
e:\uniargusvc\andytest\andytest\test.cpp(11) : error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [3]”转换为“const wchar_t *”
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换请问是什么原因呀!我该怎么修改!谢谢!
或
CStringA s;
int i = 64;
s.Format("%d", i);
项目 -> 属性 -> 配置属性 -> 常规 -> 字符集
由"使用 Unicode 字符集" 改为 "未设置"