Advertisement

win 32 app

Started by November 18, 2000 06:27 PM
4 comments, last by pizzaman 24 years, 1 month ago
im new to programming in windows. i just made a message box and that works fine, but when i try to make a window and execute i get 2 errors. my program compiles with 0 errors though. the 2 errors are Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/REAL WINDOW2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. //heres my source code #define WIN32_LEAN_AND_MEAN #include #include #include #include #define WINDOW_CLASS_NAME "WINCLASS1" // defines for windows LRESULT CALLBACK WindowProc(HWND hwnd, //window handle of sender UINT msg, //the message id WPARAM wparam, //further defines message LPARAM lparam) //further defines message { PAINTSTRUCT ps; //used in WM_PAINT HDC hdc; //handle to a device context switch(msg) { case WM_CREATE: //sent when window is first created { //do initialization stuff here return(0); }break; case WM_PAINT: //sent when window needs repainting { //validate the window hdc=BeginPaint(hwnd, &ps); //do all painting here EndPaint(hwnd,&ps); //return success return 0; }break; case WM_DESTROY: //sent when window is about to be destroyed { //kill the application, this sends a WM_QUIT message PostQuitMessage(0); //return success return(0); }break; default:break; }//end switch //process any messages that werent taken care of return (DefWindowProc(hwnd, msg, wparam, lparam)); } //can someone help me thanks to anyone that can
i am the best
Is that all of your code? Because you need a WinMain Function.
Advertisement
that would help by putting in the WinMain part. Im very new at this thanks. I dont know how ill ever remember setting up a window and etc.. The code for this is about 90 lines long!!!we shouldve all stucken with dos or just made this windows thing easier. geesh! can anyone recommend a good site on explaining classes. thanks
i am the best
There is a tut on basic windows on this site called
Game Programming Genesis by Joseph "Ironblayde" Farrell.
That should be a very helpful article for you.
Hey goto www.winprog.org there''s a great C++ win api tutorial there. It''s only 43 pages when printed but after following it you will be ready to tack most basic applications. I recomend WRIGHTING the code as you go verses cut and paste or compiling his examples, you will learn alot more.

V^^^V
** |Mortation| **
@hotmail.com
AOL:M0RTATI0N ICQ:2515421
MortÔ¿Ô¬
Andre LaMothe''s Tricks of the Windows Programming Game Gurus is excellent for this sort of thing and I leads into DirectX too. Juts keep at it, I didn''t think I could do it but I memorized how to do the WinProc, WinMain, and a basic loop without consulting any reference (which might be a waste of time... but whatever )

About classes, you may want to check out www.informit.org or .com or something. They have a free online book covering C++ by Jesse Liberty. To a search by author on Jesse Liberty and enjoy! You may need to create an account first, but that''s free to

Hope that helps

Peon
Peon

This topic is closed to new replies.

Advertisement