The following code is generating warning C6284 when compiled with /analyze on MSVC 2008 : object passed as parameter ‘%s’ when string is required in call to function.
CString strTmp, str;
str = L"aaa.txt"
strTmp.Format (L"File: %s", str);
I’m looking for a nice solution for this that would not require static_cast
Microsoft describes the usage of CString with variable argument functions here:
As an alternative you can also use the method
PCXSTR CString::GetString() const;to try to fix the warning: