Thread: Basic dialogbox shows unreadable letters

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    15

    Basic dialogbox shows unreadable letters

    Im trying to compile this in VC++ Epress 2010 using file extension .c and project type as Win32 but still i get the following warnings

    warning C4133: 'function' : incompatible types - from 'char [22]' to 'LPCWSTR'
    warning C4133: 'function' : incompatible types - from 'char [5]' to 'LPCWSTR'

    and when i run the program the text in the message box in unreadable Japanese or something. This code should not need a type cast to function running the C compiler???


    Code:
    #include <windows.h>
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,     LPSTR lpCmdLine, int nCmdShow){    
       MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK); 
       return 0;
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Unicode Programming Summary
    It means you should write UNICODE compatible code, rather than trying to just cast your way to making the compiler silent (but not removing any actual problems with the code).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3

  4. #4
    Registered User
    Join Date
    Jan 2012
    Posts
    15
    ty all works fine now!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Re-running program! displayed unreadable charactes.. HELP PLS
    By rzr.copperhead in forum C++ Programming
    Replies: 3
    Last Post: 04-03-2008, 03:39 AM
  2. What shows do you watch?
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 40
    Last Post: 04-29-2004, 02:55 PM
  3. no window shows up
    By hanhao in forum Windows Programming
    Replies: 5
    Last Post: 04-15-2004, 10:23 AM
  4. TV shows
    By Yoshi in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-13-2001, 11:37 PM