Problem in MessageBox?

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???

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

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.