|
10鱼币
我在编译一个WINDOWS窗口时提示
error C2440: '=' : cannot convert from 'long (__stdcall *)(struct HWND__ *,unsigned int,long)' to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'This conversion requires a reinterpret_cast, a C-style cast or function-style cast
LRESULT CALLBACK WndProc(HWND,UINT WPARAM,LPARAM);
#define ID_TIMER 1
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASS wnd;
static char szAppName[] = TEXT ("Beeper1") ;
wnd.style=CS_HREDRAW|CS_VREDRAW;
wnd.lpfnWndProc = WndProc;
wnd.cbWndExtra=0;
wnd.cbClsExtra=0;
wnd.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wnd.hCursor=LoadCursor(NULL,IDC_ARROW);
wnd.hIcon=LoadIcon(NULL,IDI_WINLOGO);
wnd.hInstance=hInstance;
wnd.lpszMenuName=0;
wnd.lpszClassName = szAppName;
我琢磨了老半天也不知道那错了 求大神指教
|
最佳答案
查看完整内容
把LRESULT CALLBACK WndProc(HWND,UINT WPARAM,LPARAM);改为:
LRESULT CALLBACK WndProc(HWND,UINT, WPARAM,LPARAM);
即在UINT WPARAM之间加个逗号
|