Sign in to follow this  
Meshboy

Chinese chars!

Recommended Posts

Meshboy    130
How can this become Chinese chars? I want European standard! pretty funny though... g_font->DrawText(NULL,(LPCWSTR)buffer,-,&font_rect,UNICODE,0xFFFFFFFF); //Color

Share this post


Link to post
Share on other sites
Spoonbender    1258
Quote:
Original post by Meshboy
How can this become Chinese chars? I want European standard!
pretty funny though...

g_font->DrawText(NULL,(LPCWSTR)buffer,-,&font_rect,UNICODE,0xFFFFFFFF); //Color


At a wild ugess, I'd say it could be because your buffer contains chinese chars.
(Either that, or it contains other data, which can not be meaningfully cast to LPCWSTR)

To get useful answers, you might just have to provide a bit of information about your problem. Such as what you're calling DrawText with. (It also wouldn't hurt to specify what DrawText or g_font are. We can guess, of course, but you generally get better answers when you provide enough information to make an answer *possible*

Share this post


Link to post
Share on other sites
Endurion    5407
Without further info we can only guess:

buffer is an ascii string (char array), it didn't compile, so you simply pasted (LPCWSTR) in front of it.

Your project seems to use Unicode, tries to process the string as unicode and fails.

If your string is a literal (constant), you can put a L in front of it:

g_font->DrawText( NULL, L"Hello World, ... )


If not, you have to convert your ascii string to unicode with MultiByteToWideChar.


Or you can explicitely use the ascii version of DrawText (DrawTextA).

Share this post


Link to post
Share on other sites
Let me guess, you are using Visual C++? If so, go to project settings,configuration properties, and under project defaults you should see character set. Change it from Unicode to multi byte.

If you aren't using Visual C++, I cannot help you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this