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.

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);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.