0

Hello everyone..

When working with Visual Studio 2010, the "MessageBox" function displays chinese characters, instead of english ones.

Example: I attempted to prompt a message to myself using the messagebox function, saying "Success!" However, the message box pops up a message in chinese, and not in english.

I am able to display the message in english using visual studio 6.0, but not 2010. Anyone know the reason why the display is in chinese?

char * mymessage     = "Success!";
char * titleofwindow = "MyMessage";
MessageBox(hWnd, (LPCWSTR)mymessage, (LPCWSTR)titleofwindow, MB_ICONERROR);

Thanks in advance.

Edited by PixelExchange: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by PixelExchange
0

You need to use wide char. Try this :

wchar_t *msg = L"Hello world";
wchar_t *title = L"Greeting";
MessageBox(hWnd,msg,title,MB_OK);

Edited by firstPerson: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.