D David Wilkinson Mar 6, 2007 #2 Bit said: Are there any macros for converting between these two string types ? Click to expand... Bit Byte: Please don't put the whole question in the title. Very likely you do not really want to make this conversion. You must understand that in non-Unicode build TCHAR is CHAR (char) while in Unicode build it is WCHAR (wchar_t). A good way to use the standard library in Windows programs is typedef std::basic_string<TCHAR> tstring; TCHAR str[] = _T("Testing"); tstring s = str; This will compile in either Unicode or non-Unicode build. If your program really uses both 8-bit and 16-bit strings you should look at W2A family of macros, or WideCharToMultiByte(). David Wilkinson
Bit said: Are there any macros for converting between these two string types ? Click to expand... Bit Byte: Please don't put the whole question in the title. Very likely you do not really want to make this conversion. You must understand that in non-Unicode build TCHAR is CHAR (char) while in Unicode build it is WCHAR (wchar_t). A good way to use the standard library in Windows programs is typedef std::basic_string<TCHAR> tstring; TCHAR str[] = _T("Testing"); tstring s = str; This will compile in either Unicode or non-Unicode build. If your program really uses both 8-bit and 16-bit strings you should look at W2A family of macros, or WideCharToMultiByte(). David Wilkinson