I'd go with plain wchar_t
The advantage to TCHAR
is that it allows you to toggle Unicode on and off and your code accessing the Windows API will keep working.
The problem with it is that no other API will accept it.
std::cout
will choke on a std::wstring,
std::string will choke on being initialized with a wchar_t*
and so on.
From the point of view of every other library, you should use either char
or wchar_t
, and switching between them is nontrivial.
And since non-Unicode compatibility was only really an issue in Windows 95, there's really no point in supporting both any more. Enable Unicode, use wchar_t
and save yourself the headaches.
OF course, to avoid confusion then, you might also want to call the *W versions of Win32 functions. Instead of CreateWindow, CreateWindowW, for example, so that even if someone compiles your code with Unicode disabled in the project settings, the code will still work. If you're going to hardcode for Unicode support, you might as well do so consistently.