|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] 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_USEDEFAULT,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
|
|