Click to See Complete Forum and Search --> : C++/Win32 & Unicode


armen kc
July 27th, 2006, 04:40 AM
Hello - Thanks For Your Time.
I want to write unicode characters with This Code.

TextOutW(lpdis->hDC, 28,6,L"♣", 3);

But result is Not ♣ - Instead of this - TextOutW will dispaly 3 other characters.
I use 3 in Number of strings argument becouse of This.
please explain how i can do this - Thanks agian.

scathenC
July 27th, 2006, 12:29 PM
have you selected a font that contains that character?

armen kc
July 27th, 2006, 12:58 PM
please explain more about font - i dont know about that - Thanks

scathenC
July 27th, 2006, 01:20 PM
well the textout function draws the text to the current DC using the
currently selected font. If the current font doesn't contain the characters
you are trying to draw then you will get something else.

See SelectObject() & HFONT.

armen kc
July 27th, 2006, 02:09 PM
very Thanks - Now TextOutW API write ♣
Excuse me - Now I have another question :

When I want to write in Edit Control , in certain language , result isnt that i want.
for example instead of Ա is ? question mark.
My Code is this :
hWndEditBox = CreateWindowW(
L"EDIT",
L"Insert Text",
WS_VISIBLE | WS_CHILD |WS_BORDER,
10,
10,
100,
50,
hWnd,
(HMENU)IDC_EDITBOX_TEXT,
(HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE),
NULL);
if you know . please explain about this & is this a way that i use for localization. (Thanks)

scathenC
July 27th, 2006, 10:36 PM
it is most likely the same issue as textout. Edit boxes also use a default
font. see WM_SETFONT, and use the same font you were using for you
textout call.

I can't remember how but i am pretty sure you can set the default font,
so that all your controls will use the same one which you can set to you
unicode font.

armen kc
July 27th, 2006, 11:39 PM
very Thanks.
I hope that i will see you in future threads . Thanks for your answers & guides. By.