Results 1 to 2 of 2

Thread: Problem in MessageBox?

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Location
    Rawalpindi, Pakistan
    Posts
    26

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

  2. #2
    Senior Member
    Join Date
    Sep 2003
    Location
    Seattle, WA
    Posts
    246

    Re: Problem in 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •