PDA

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



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

#define WIN32_LEAN_AND_MEAN

#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

mikael_aronsson
11-16-2003, 11: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 ?

Mikael

Honk
11-16-2003, 12:44 PM
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.

Mylu
11-17-2003, 09:26 AM
--------------------Configuration: ghgty - Win32 Debug--------------------
Compiling...
tyt.cpp
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

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