In addition to solution 1:
If you need to format a string with a
char*
string argument, you can specify this in the format by using the
h
prefix:
char buffer[100] = "A char* string";
CString strTmp;
strTmp.Format(_T("%hs"), buffer)
This will convert the
char*
string to a wide string during runtime and insert that with Unicode builds. With non-Unicode builds the prefix is ignored.