Default TCHAR of VC2005 or later is UNICODE. CString template class also use UNICODE as CStringW by default. For example, TRACE(_T"%s"), _T("Foo"));
Bug on Various Arguments
TRACE and other printf-like function have varargs, which are not work implicit type conversion because these types are not known by the compiler. As conversion operator of CString works in other case, the fact that conversion is not work may be forgotten. This mismatch occurs undefined-behavior of C++. The below example is modified to the following; CString foo; TRACE(_T("%s"),static_cast
IO error on TRACE in Japanese with UNICODE
TRACE may fail to output Japanese by default. In this case, VC say "_CrtDbgReport: String too long or IO Error". Its solution is the following; #include
std::setlocale(LC_ALL, "Japanese");