windows程序设计的一个问题

intWINAPIWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,PSTRszCmdLine,intiCmdShow)... int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("HelloWin") ;
HWND hwnd ;
MSG msg ;
WNDCLAS wndclass ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuNam = NULL ;
wndclass.lpszClassName = szAppName ;
为什么这段代码在vc++出错,

e:\vc\microsoft visual studio\myprojects\25\52.cpp(9) : error C2065: 'WNDCLAS' : undeclared identifier
e:\vc\microsoft visual studio\myprojects\25\52.cpp(9) : error C2146: syntax error : missing ';' before identifier 'wndclass'
e:\vc\microsoft visual studio\myprojects\25\52.cpp(9) : error C2065: 'wndclass' : undeclared identifier
e:\vc\microsoft visual studio\myprojects\25\52.cpp(10) : error C2228: left of '.style' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(11) : error C2228: left of '.lpfnWndProc' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(12) : error C2228: left of '.cbClsExtra' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(13) : error C2228: left of '.cbWndExtra' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(14) : error C2228: left of '.hInstance' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(15) : error C2228: left of '.hIcon' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(16) : error C2228: left of '.hCursor' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(17) : error C2228: left of '.hbrBackground' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(18) : error C2228: left of '.lpszMenuNam' must have class/struct/union type
e:\vc\microsoft visual studio\myprojects\25\52.cpp(19) : error C2228: left of '.lpszClassName' must have class/struct/union type
展开
 我来答
lokily2010
2013-12-11 · TA获得超过284个赞
知道小有建树答主
回答量:776
采纳率:100%
帮助的人:584万
展开全部
缺少 <windows.h> 头文件
追问
我加了,不然错误提示就不会只有这几个了
追答
WNDCLAS==>WNDCLASS  少了个s
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式