当我将int转换为CString时,源代码如下所示
int count = 0;
CString msg;
msg.Format("%d", count); // error
错误信息是
IntelliSense: no instance of overloaded function
"ATL::CStringT::Format [with
BaseType=wchar_t, StringTraits=StrTraitMFC_DLL ATL::ChTraitsCRT>]" matches the argument list
argument types are: (const char [4]) object type is:
CString
我该如何解决这个问题?
最佳答案
在 _T() 中包含“%d”
msg.Format(_T("%d"), count);
关于c++ - MFC:CSting IntelliSense:没有重载函数的实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22370247/