关于WndProc回调函数
我在编译一个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之间加个逗号 仰望天上的光 发表于 2014-8-9 17:24
把LRESULT CALLBACK WndProc(HWND,UINT WPARAM,LPARAM);改为:
LRESULT CALLBACK WndProc(HWND,UINT, W ...
:sweat: 有粗心了。。。。 943566987 发表于 2014-8-9 23:23
有粗心了。。。。
问题解决就顺便把分类改为“已解决”状态,另外悬赏也请及时奖励给帮到你的朋友哦~~ 支持學習學習 这个很粗细呀你 {:7_146:}
页:
[1]