How to convert a std::wstring
to a TCHAR*
? std::wstring.c_str()
does not work since it returns a wchar_t*
.
How do I get from wchar_t*
to TCHAR*
, or from std::wstring
to TCHAR*
?
#include <atlconv.h>
TCHAR *dst = W2T(src.c_str());
Will do the right thing in ANSI or Unicode builds.