UNICODE convention
-
Hello, I'm using eVC++ 3.00 and I want to do such a thing:
MessageBox("Test");
But I'll have an error at compilation: error C2664: 'MessageBoxW' : cannot convert parameter 1 from 'char [29]' to 'const unsigned short *' So, it's because UNICODE convention is used as standard. I suppressed it from the preprocessor settings but it still doesn't work! Is ANSI convention not supported ?? Thanks -
Hello, I'm using eVC++ 3.00 and I want to do such a thing:
MessageBox("Test");
But I'll have an error at compilation: error C2664: 'MessageBoxW' : cannot convert parameter 1 from 'char [29]' to 'const unsigned short *' So, it's because UNICODE convention is used as standard. I suppressed it from the preprocessor settings but it still doesn't work! Is ANSI convention not supported ?? ThanksWindows CE only supports UNICODE. All MFC methods and API functions and messages (with some notable exceptions) take UNICODE text. So, your code MUST read:
MessageBox(_T("Test"));
-
Windows CE only supports UNICODE. All MFC methods and API functions and messages (with some notable exceptions) take UNICODE text. So, your code MUST read:
MessageBox(_T("Test"));
That's it :-) !! This will give me a lot of work to convert my existing library :-( ! Is there a simple way to convert ANSI string to UNICODE string?
char Buff[255]; ... ... // Do some stuff with Buff ... MessageBox(Buff); // Need conversion here !!
Thanks -
That's it :-) !! This will give me a lot of work to convert my existing library :-( ! Is there a simple way to convert ANSI string to UNICODE string?
char Buff[255]; ... ... // Do some stuff with Buff ... MessageBox(Buff); // Need conversion here !!
ThanksThe best thing for you is start replacing
char
withTCHAR
. If you want to do UNICODE to ANSI on-the-fly conversions, your application will run slower. But if you insist, use thembstowcs
,mbtowc
,wcstombs
andwctomb
(check these out from the online help). -
The best thing for you is start replacing
char
withTCHAR
. If you want to do UNICODE to ANSI on-the-fly conversions, your application will run slower. But if you insist, use thembstowcs
,mbtowc
,wcstombs
andwctomb
(check these out from the online help).Ok, thanks a lot :-) ! I'll try to replace as more as possible char with TCHAR then ! Thanks