View Full Version : help with this code (soz other psot not contain code)

11-16-2003, 09:54 AM
heres the code *:


#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
messageBox(NULL, "hello, world!", "My First Windows Application", NULL);
return 0;

please tell me whats wrong it always says 1 error cannot compile with msvc++ 6.0 stand edition.. or i need to use other program ? or why it wont work or how to fix the problem please ive tried for over 1 month on websites ect trying to get how to fix but pelase help!! it would be very apprieciated

11-16-2003, 10:29 AM
Hi !

Could you please post the exact error message you get (it includes an error code, like C1234 for example) and a line number, and is it a compilation error (I guess it is) or a linking error ?


11-16-2003, 11:44 AM
A wild guess (because you did not provide much info to work with), you are trying to compile this code as a "console" project and not as a "Win32 Application" project.

11-17-2003, 08:26 AM
--------------------Configuration: ghgty - Win32 Debug--------------------
c:\program files\microsoft visual studio\myprojects\ghgty\tyt.cpp(7) : error C2065: 'messageBox' : undeclared identifier
Error executing cl.exe.

tyt.obj - 1 error(s), 0 warning(s)

thats the eror message i do it in when i make the file its in well ive tried it in consel and other and tried it in all of the things i can ok so please helpo me

11-17-2003, 08:36 AM
Use MessageBox instead of messageBox. And then pick up a book on C/C++ and find out why those are different.