You only need
tchar.h and the
TCHAR
type if you want to produce both ASCII and Unicode versions of your code. If you do it this way then you should use the following types:
TCHAR character; TCHAR* character_array; PTCHAR character_array; PTSTR character_string; PCTSTR constant_string = _T("A constant string");
The compiler will then generate the correct types and literals based on the setting of the
UNICODE
define in your project General settings.
If you are converting to Unicode only, then you can use the above types or redefine to all wide characters and use:
WCHAR character; WCHAR* character_array; PWCHAR character_array; PWSTR character_string; PCWSTR constant_string = L"A constant string";
If your program uses MFC or WTL then you could use
CString
as an alternative.