compile没错,build时就出错,错在哪儿?
园区宅男 2003-08-23 03:04:15 #include <windows.h>
LRESULT CALLBACK WindowFunc(HWND,UINT,WPARAM,LPARAM);
char SZWinName[]="MyWin";
int WINAPI WinMain(HINSTANCE hThisInst,HINSTANCE hPrevInst,
LPSTR lpszArgs,int nWinMode)
{
HWND hwnd;
MSG msg;
WNDCLASS wcl;
wcl.hInstance=hThisInst;
wcl.lpszClassName=SZWinName;
wcl.lpfnWndProc=WindowFunc;
wcl.style=0;
wcl.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wcl.hCursor=LoadCursor(NULL,IDC_ARROW);
wcl.lpszMenuName=NULL;
wcl.cbClsExtra=0;
wcl.cbWndExtra=0;
wcl.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
if(!RegisterClass(&wcl))return 0;
hwnd=CreateWindow(
SZWinName,
"Windows 98 Framework",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
HWND_DESKTOP,
NULL,
hThisInst,
NULL
);
ShowWindow(hwnd,nWinMode);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WindowFunc(HWND hwnd,UINT message,
WPARAM wParam,LPARAM lParam)
{
switch(message){
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,
message,wParam,lParam);
}
return 0;
}
//这段程序在compile时没错,build时就出错,为什么?