PDA

View Full Version : unused parameter warning and english being displayed as chinese



partha7817
26th May 2015, 22:09
I was compiling a basic GUI application written in C language meant to run on windows 7 using qt creator using mingw platform the code is :

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

the compiler warnings relate to unused parameter "hInstance" but it runs ok, but the sentence "Goodbye, cruel world!" is being displayed as chinese

11175

what may be the problem and how to rectify? pls help

d_stranz
26th May 2015, 22:37
Well of course. You're trying to use Qt Creator to compile a program written using an abominable operating system's native API, not the vastly superior Qt API. Port the program to use Qt and all will be fine.

partha7817
28th May 2015, 08:12
can I mend the project file to use qT API or do I have to start a new project altogether and copy-paste same code?

stampede
29th May 2015, 10:13
copy-paste same code
Sorry, but I think you won't get far in programming with such attitude :)
If you don't know where to start, then "widget" examples from your Qt installation is a good place.
http://doc.qt.io/qt-5/examples-widgets.html

partha7817
30th May 2015, 16:52
:p sorry boss just impatient

ChrisW67
30th May 2015, 22:31
Since no part of Windows is actually going to translate your message it seems possible that you are looking at a system Or program runtime library runtime error message on a non-English Windows.