wc.lpfnWndProc = WindowProc shotgun blues
Hello,
I cannot get that line of the Window set-up routines to work! Here is my code:
wc.lpfnWndProc = (WNDPROC) WindowProc;
and the WindowProc code -
LRESULT CALLBACK WindowProc(HWND hWnd, unsigned uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDM_EXIT:
DestroyWindow(hWnd);
break;
}
break;
case WM_PAINT:
PAINTSTRUCT ps;
BeginPaint(hWnd, &ps);
DrawImage();
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
Cleanup();
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return 0L;
}
Could someone please tell me why I am told I''m ''re-defining WindowProc''? Please?
Thanks,
Wilben.
Wilben
wilben@nerdy.freeserve.co.uk
Because WindowProc is already defined in windows.h as a type that is a pointer to a window''s procedure.
Try switching the name from WindowProc to WndProc. That should work.
Try switching the name from WindowProc to WndProc. That should work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement