Basic dialogbox shows unreadable letters

This is a discussion on Basic dialogbox shows unreadable letters within the Windows Programming forums, part of the Platform Specific Boards category; Im trying to compile this in VC++ Epress 2010 using file extension .c and project type as Win32 but still ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,447
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 10:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21