#include<windows.h>
LRESULT CALLBACK WndProc (HWMD,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,hPrevInstance,
PSTR szCmdLine,int iCmdShow)//error C2146: syntax error : missing ')' before identifier 'szCm
//error C2081: 'hPrevInstance' : name in formal parameter list il
//error C2081: 'PSTR' : name in formal parameter list illegal
//error C2061: syntax error : identifier 'szCmdLine'
//error C2059: syntax error : ';'
//error C2059: syntax error : ','/
//error C2059: syntax error : ')'
{
static TCHAR szAppName[]=TEXT("hELLOwIN");
HWND hwnd;
MSG msg;
WNDCLASS 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.hbrBackgrond=(HBRUSH)GETsTOCKoBJECT(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=szAppName;
if(!RegisterClass(&wndclass))
{
Message(NULL,TEXT("This program reqires Windows NT!"),
szAppName,MB_ICONERROR);
return 0;
}
hwnd=CreateWindow(szAppName,
TExt("The Hello Program"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}LRESULT CALLBACK WndProc (HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
{
case WM_CREATE:
PlaySound(TEXT("hellowin.wav"),NULL,SND_FILENAME|SND_ASYNC);
return 0;
case MWM_PAINT:
//error C2051: case expression not constant
// error C2065: 'MWM_PAINT' : undeclared identifier[b]
hdc=BeginPaint(hwnd,&ps);
GetClientRect(hwdn,&rect);
// error C2065: 'hwdn' : undeclared identifier
//warning C4047: 'function' : 'struct HWND__ *' differs in levels of indirection from 'int '
//warning C4024: 'GetClientRect' : different types for formal and actual parameter 1 DrawText(hdc,TEXT("Hello,Windows 98!"),-1,&rect,
DT_SINGLELINE|DT_CENTER|DT_VCENTER);
EndPaint(hwnd,&ps);
return 0;
case MWM_DESTROY:
//error C2051: case expression not constant
//error C2065: 'MWM_DESTROY' : undeclared identifier
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}
LRESULT CALLBACK WndProc (HWMD,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,hPrevInstance,
PSTR szCmdLine,int iCmdShow)//error C2146: syntax error : missing ')' before identifier 'szCm
//error C2081: 'hPrevInstance' : name in formal parameter list il
//error C2081: 'PSTR' : name in formal parameter list illegal
//error C2061: syntax error : identifier 'szCmdLine'
//error C2059: syntax error : ';'
//error C2059: syntax error : ','/
//error C2059: syntax error : ')'
{
static TCHAR szAppName[]=TEXT("hELLOwIN");
HWND hwnd;
MSG msg;
WNDCLASS 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.hbrBackgrond=(HBRUSH)GETsTOCKoBJECT(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=szAppName;
if(!RegisterClass(&wndclass))
{
Message(NULL,TEXT("This program reqires Windows NT!"),
szAppName,MB_ICONERROR);
return 0;
}
hwnd=CreateWindow(szAppName,
TExt("The Hello Program"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}LRESULT CALLBACK WndProc (HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
{
case WM_CREATE:
PlaySound(TEXT("hellowin.wav"),NULL,SND_FILENAME|SND_ASYNC);
return 0;
case MWM_PAINT:
//error C2051: case expression not constant
// error C2065: 'MWM_PAINT' : undeclared identifier[b]
hdc=BeginPaint(hwnd,&ps);
GetClientRect(hwdn,&rect);
// error C2065: 'hwdn' : undeclared identifier
//warning C4047: 'function' : 'struct HWND__ *' differs in levels of indirection from 'int '
//warning C4024: 'GetClientRect' : different types for formal and actual parameter 1 DrawText(hdc,TEXT("Hello,Windows 98!"),-1,&rect,
DT_SINGLELINE|DT_CENTER|DT_VCENTER);
EndPaint(hwnd,&ps);
return 0;
case MWM_DESTROY:
//error C2051: case expression not constant
//error C2065: 'MWM_DESTROY' : undeclared identifier
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}
解决方案 »
- 虚拟机装win7 32位操作系统BIOS设置问题
- 为什么访问内网速度很慢,外网下载速度却正常。
- jmail.dll 点击运行需要打开方式 在其他电脑上可以直接运行 求大神告知是哪里出了问题
- WIN10 (主机无线网)+ VMware 12 + Centos 7 ----虚拟机无法连上网络
- 使用access的一次查询可不可以做出表格这样的查询结果,要用于租借与归还的统计查询
- MQJE001: MQException 出现:完成代码是 2,原因为 2058
- 求VBA统计本月数和年度总计
- 双系统如何重新引导win10
- 求桌面运维的一些实用工具!
- 使用谁后悔Elementary OS吧
- ie11 开发者工具 的功能导航栏 如何调节横置或者纵置?
- Windows系统日志能实现人工编辑吗?
LRESULT CALLBACK WndProc (HWND,UINT,WPARAM,LPARAM);/*int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,hPrevInstance,*/
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,
PSTR szCmdLine,int iCmdShow)//error C2146: syntax error : missing ')' before identifier 'szCm
//error C2081: 'hPrevInstance' : name in formal parameter list il
//error C2081: 'PSTR' : name in formal parameter list illegal
//error C2061: syntax error : identifier 'szCmdLine'
//error C2059: syntax error : ';'
//error C2059: syntax error : ','/
//error C2059: syntax error : ')'
{
static TCHAR szAppName[]=TEXT("hELLOwIN");
HWND hwnd;
MSG msg;
WNDCLASS 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.hbrBackgrond=(HBRUSH)GETsTOCKoBJECT(WHITE_BRUSH);*/
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=szAppName; if(!RegisterClass(&wndclass))
{
/*Message(NULL,TEXT("This program reqires Windows NT!"),*/
MessageBox(NULL,TEXT("This program reqires Windows NT!"),
szAppName,MB_ICONERROR);
return 0;
} hwnd=CreateWindow(szAppName,
/*TExt("The Hello Program"),*/
TEXT("The Hello Program"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd); while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
} return msg.wParam;
}LRESULT CALLBACK WndProc (HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
{
case WM_CREATE:
PlaySound(TEXT("hellowin.wav"),NULL,SND_FILENAME|SND_ASYNC);
return 0; /*case MWM_PAINT:*/
case WM_PAINT:
//error C2051: case expression not constant
// error C2065: 'MWM_PAINT' : undeclared identifier[b]
hdc=BeginPaint(hwnd,&ps);
/*GetClientRect(hwdn,&rect);*/
GetClientRect(hwnd,&rect);
// error C2065: 'hwdn' : undeclared identifier
//warning C4047: 'function' : 'struct HWND__ *' differs in levels of indirection from 'int '
//warning C4024: 'GetClientRect' : different types for formal and actual parameter 1 DrawText(hdc,TEXT("Hello,Windows 98!"),-1,&rect,
DT_SINGLELINE|DT_CENTER|DT_VCENTER);
EndPaint(hwnd,&ps);
return 0; /*case MWM_DESTROY:*/
case WM_DESTROY:
//error C2051: case expression not constant
//error C2065: 'MWM_DESTROY' : undeclared identifier
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}