“void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [6]”转换为“const wchar_t *”
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
解决方法:
CString str;
str.Format(("%d,%d")x,y);
改为 str.Format(_T("%d,%d"),x,y);
本文解决了在使用CStringT进行格式化输出时遇到的类型不匹配问题,详细介绍了如何通过_T宏正确地指定宽字符字符串。

2870

被折叠的 条评论
为什么被折叠?



