vc++ 窗口程序编译只一出错误查了N久查不出,哪位高手来帮看看??

来源:百度知道 编辑:UC知道 时间:2024/06/21 14:49:10
#include <windows.h>

LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);

int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmdShow // show state of window
);

{ HWND hwnd;
MSG Msg;
WNDCLASS wndclass;

char lpszClassName[]="窗口";
char lpszTitle[]="窗口示例程序";

wndclass.style=0;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadCursor(NULL,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=lpszClassName;

if(!RegisterClass(&wndclass

int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmdShow // show state of window
);

把这句最后的分号去掉就可以了.

恩,SDK编程的范例阿。似乎没有毛病。我手里没有xp和vc,没法给你试,但是如果只是一个错误的话,可能是你装的VC是那个有毛病的垃圾中文版,那个版不太好,总出错,你换个标准的英文版试试。
==================
老大,你倒是把编译器给出的错误的详细内容贴上来阿,要不怎么给你看?