|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: MS Visual C++
Hiya Josiah, Simple typo. You've specified a forward declaration of LRESULT APIENTRY WndProc(HWND,UINT,WPARAM,LPARAM); And then you haven't defined it, which is not the bad thing; the bad thing is that you then tried to make use of it in, WinMain, like this, win.lpfnWndProc = (WNDPROC)WndProc; I think if you change the name of LRESULT APIENTRY WinProc(HWND handle, UINT message,WPARAM data1,LPARAM data2) defined later in the program to WndProc (or vice versa), you'll have a lot more joy. Good luck Thomas. ____________________________________________________ Thomas R. Schar (Professional Officer) Trusted Computer Systems/Information Technology Division/DSTO/Australia Tel: +61-08-8259 6445; Fax: +61-08-8259 5980; Mob: +61-0412-310647 Email: mailto://thomas.schar@dsto.defence.gov.au -----Original Message----- From: Josiah Avery [mailto:josiahavery@hotmail.com] Sent: Friday, 17 March 2000 6:30 AM To: gameprogrammer@gameprogrammer.com Subject: Re: MS Visual C++ Hello all, I am trying to get this simple application going but am getting the following two link errors: souce.obj : error LNK2001: unresolved external symbol "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) Debug/window.exe : fatal error LNK1120: 1 unresolved externals The listing is as such: #include <windows.h> typedef LPCTSTR WIN_STRING; WIN_STRING className = "Sample Win98 application"; WIN_STRING menuName = "Sample Win98 application, dev by l0w_karma"; LRESULT APIENTRY WndProc(HWND,UINT,WPARAM,LPARAM); int WINAPI WinMain(HINSTANCE thisInstance, HINSTANCE prevInstnce, LPSTR commandArg, int winArg) { HWND winHand = NULL; MSG message; WNDCLASS win; win.lpszClassName = className; win.lpszMenuName = className; win.lpfnWndProc = (WNDPROC)WndProc; win.hInstance = thisInstance; win.style = CS_HREDRAW|CS_VREDRAW; win.hIcon = LoadIcon(thisInstance,className); win.cbClsExtra = 0; win.cbWndExtra = 0; win.hCursor = LoadCursor(NULL,IDC_ARROW); win.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); if(!RegisterClass(&win)) return FALSE; winHand = CreateWindow(className,menuName,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFA ULT,640,480,winHand,NULL,thisInstance,NULL); if(!winHand) return FALSE; ShowWindow(winHand,winArg); UpdateWindow(winHand); while(GetMessage(&message,NULL,0,0)) { TranslateMessage(&message); DispatchMessage(&message); } return TRUE; } LRESULT APIENTRY WinProc(HWND handle, UINT message,WPARAM data1,LPARAM data2) { HDC hdc; PAINTSTRUCT paint; switch(message) { case WM_PAINT: hdc = BeginPaint(handle,&paint); EndPaint(handle,&paint); return 0; case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(handle,message,data1,data2); } *** thanks in advance for any help. Josiah Avery aka l0w_karma ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com ================================================================= The GameProgrammer.Com mailing list is for the open discussion of any topic related to the art, science, and business of programming games. This list is especially tolerant of beginners. We were all beginners once To SUBSCRIBE or UNSUBSCRIBE please visit: http://gameprogrammer.com/mailinglist.html ================================================================= The GameProgrammer.Com mailing list is for the open discussion of any topic related to the art, science, and business of programming games. This list is especially tolerant of beginners. We were all beginners once To SUBSCRIBE or UNSUBSCRIBE please visit: http://gameprogrammer.com/mailinglist.html
|
|