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 展开
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 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询