Conversion problem
-
I am using _UNICODE as a directive but want my code to compile without errors without _UNICODE. Can anyone tell me is there any way to switch between functions same way i do for strings #ifdef _UNICODE typedef wchar_t TCHAR; #define __T(x) L ## x #else typedef char TCHAR; #define __T(x) x #endif can i do something same for wcscpy and _tcslen functions. I am using wcscpy in wchar and strcpy for const char*
-
I am using _UNICODE as a directive but want my code to compile without errors without _UNICODE. Can anyone tell me is there any way to switch between functions same way i do for strings #ifdef _UNICODE typedef wchar_t TCHAR; #define __T(x) L ## x #else typedef char TCHAR; #define __T(x) x #endif can i do something same for wcscpy and _tcslen functions. I am using wcscpy in wchar and strcpy for const char*
You can use
_tcscpy
which will be eitherstrcpy
orwcscpy
, depending on_UNICODE
.http://www.readytogiveup.com/[^] - Do something special today. http://www.totalcoaching.ca/[^] - Give me some feedback about this site !
-
I am using _UNICODE as a directive but want my code to compile without errors without _UNICODE. Can anyone tell me is there any way to switch between functions same way i do for strings #ifdef _UNICODE typedef wchar_t TCHAR; #define __T(x) L ## x #else typedef char TCHAR; #define __T(x) x #endif can i do something same for wcscpy and _tcslen functions. I am using wcscpy in wchar and strcpy for const char*
As Rage mentioned....all the CRT string functions have a generic equivelant. Here's a handy chart: Routine Mappings[^]
Mark Salsbery Microsoft MVP - Visual C++ :java: