Help Im dumb

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
StuCollier
Posts: 52
Joined: Tue Mar 30, 2004 12:16 pm

Help Im dumb

Post by StuCollier »

Code: Select all

void StaticTextChange( char *addtext ) 
{
    wchar_t msg[20];
    swprintf(msg, 20, L"%s", addtext);
    StaticTextPtr->setText(msg);     // static text
}
Why does this create little squares in the statictextbox ?

What have I missed ?
StuC
Freeware games
www.ovine.net
StuCollier
Posts: 52
Joined: Tue Mar 30, 2004 12:16 pm

Post by StuCollier »

I found that swprintf works fine for converting number or constant text

Ive now found ....

Code: Select all

mbstowcs(msg,addtext,20);
which works fine..... be interested to know why swprinf doesnt :)
StuC
Freeware games
www.ovine.net
lilo

Post by lilo »

hi
swprintf works fine! you just need to make 'addtext' a pointer to wchar_t rather than char :wink:
yin nadie
Posts: 43
Joined: Wed Mar 31, 2004 1:03 pm
Location: Seville, Spain
Contact:

Post by yin nadie »

for me, swprintf tends to work awfully bad when compiling under windows, and perfectly well under linux.

In windows, i always get those pretty (as hell) squares
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Hmm, that sounds like the correct character isn't being used, I don't know why it would do that. Sounds pretty erratic. Do you recon it could be loading the wrong character set?
Post Reply