Microsoft describes the use of CString with variable argument functions here :
CString kindOfFruit = "bananas"; int howmany = 25; printf_s( "You have %d %s\n", howmany, (LPCTSTR)kindOfFruit );
Alternatively, you can also use the PCXSTR CString::GetString() const; method PCXSTR CString::GetString() const; to try to fix the warning:
CString strTmp, str; str = L"aaa.txt" strTmp.Format (L"File: %s", str.GetString());
Frank bollack
source share