TCHAR* to WCHAR*
I'm using c++ and I need to cast a value in a TCHAR* (char*) to a WCHAR*. The normal typecast ((WCHAR*)strtchar) works when compiling, but doesn't work on runtime. Could someone please tell me how I can do this? Thank you in advance.
[edited by - Newfound Ajarn on November 11, 2003 1:51:43 AM]
TCHAR compiles differently depending on whether you have UNICODE defined for your project. If UNICODE is not defined, a TCHAR is the same as a char. If UNICODE is defined, then a TCHAR is a wchar_t.
Having said that, the conversion functions you are probably looking for are mbstowcs() and wcstombs() (MBS stands for ''multi-byte string'' and wcs is ''wide character string''). Look on msdn.microsoft.com for the exact arguments.
Having said that, the conversion functions you are probably looking for are mbstowcs() and wcstombs() (MBS stands for ''multi-byte string'' and wcs is ''wide character string''). Look on msdn.microsoft.com for the exact arguments.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement