how to display unicode without unicode built?
-
I want to display a unicode string in my CStatic(label) control. But I don't want to bulit my application unicode(add _UNICODE/UNICODE in preprocessor). Is there any solution?
-
I want to display a unicode string in my CStatic(label) control. But I don't want to bulit my application unicode(add _UNICODE/UNICODE in preprocessor). Is there any solution?
You can never display UNICODE text in a non-unicode application. Therefore, your only solution would be to display it as an image.
Nobody can give you wiser advice than yourself. - Cicero
-
You can never display UNICODE text in a non-unicode application. Therefore, your only solution would be to display it as an image.
Nobody can give you wiser advice than yourself. - Cicero
Thanks.
-
I want to display a unicode string in my CStatic(label) control. But I don't want to bulit my application unicode(add _UNICODE/UNICODE in preprocessor). Is there any solution?
-
You can never display UNICODE text in a non-unicode application. Therefore, your only solution would be to display it as an image.
Nobody can give you wiser advice than yourself. - Cicero
This is not the case. Take the following example ANSI application:
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MessageBoxW(NULL, L"This string is UNICODE!", L"Unicode", MB_OK);return 0;
}
In this case all the
UNICODE
define (and related ones) does is map the macroMessageBox
to either theMessageBoxA
function (non-UNICODE) or theMessageBoxW
function (UNICODE). By usingMessageBoxW
we get the UNICODE version regardless the the setting.Steve
-
I think you could use code similar to the following:
::SetWindowTextW(m_Static.m_hWnd, L"Unicode text here");
Wherem_Static
is your static control.this is this.
Yeah, I have tried that. But what it displayed only "????????????" So I think the only way is building it in unicode
-
I want to display a unicode string in my CStatic(label) control. But I don't want to bulit my application unicode(add _UNICODE/UNICODE in preprocessor). Is there any solution?
-
Yeah, I have tried that. But what it displayed only "????????????" So I think the only way is building it in unicode
It worked perfectly when I tried it just then. Also, you may want to investigate the
CCM_SETUNICODEFORMAT
message.Steve
-
This is not the case. Take the following example ANSI application:
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MessageBoxW(NULL, L"This string is UNICODE!", L"Unicode", MB_OK);return 0;
}
In this case all the
UNICODE
define (and related ones) does is map the macroMessageBox
to either theMessageBoxA
function (non-UNICODE) or theMessageBoxW
function (UNICODE). By usingMessageBoxW
we get the UNICODE version regardless the the setting.Steve
Thanks for pointing it out, I think I've been avoiding ANSI builds for all good reasons. I've never tried what you've suggested.
Nobody can give you wiser advice than yourself. - Cicero