PDA

View Full Version : Problem in MessageBox?



qasim1981
11-22-2004, 07:13 PM
Hi, in VC 6.0, we create message boxes like this:

int a=MessageBox(NULL,"Messege here", "Title hereMB_YESNO);

but in eVC4.0 as indicated in Help context, if we try to create like this :

int a= MessageBox(NULL,"Message","Title",MB_OK);

it results in following error:

error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [8]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

HOW TO SOLVE IT, AND HOW TO DISPLAY THE MESSAGEBOX???

hmwill
11-22-2004, 08:48 PM
Use L"blah" instead of "blah", or use TCHAR and related macros defined in the Windows SDK. On Pocket PC everything is Unicode.

Hope that helps.

- HM