quick unicode question

Started by
3 comments, last by squirrel_of_death 18 years, 10 months ago
Hi there, I've spent way too long on this already, and I still don't know what's going wrong. Very simple, I have a windows button, and am trying to set the text on the button to be two lines, and so I'm doing the following : TCHAR *text = TEXT("clear\r\nimages"); m_hwndButton = (blah blah.. text, blah blah); and what the button displays is : clear||images Any help please? thanks!
Advertisement
How are you setting the text on the button?

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I tried two ways, first with the text variable, as in :
TCHAR *text = TEXT("clear\r\nimages");
being passed as the 3d field ( CreateWindowEx ), and secondly I tried sending it a WM_SETTEXT message, which also got the wrong || characters instead of a newline.

:(

*edit* I also tried creating a regular string of the same text, and then MultiByteToWideChar'ing it, and passing that to the button, but this also didn't work. I believe the error lies somewhere in win32, and my understanding of it.
Try setting the BS_MULTILINE style on the button when you call CreateWindowEx(); if the text characters are displaying correctly it isn't a Unicode problem.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

thank you, that solved the problem. Cheers!

This topic is closed to new replies.

Advertisement