wc.lpfnWndProc = WindowProc shotgun blues

Started by
0 comments, last by Wilben 24 years, 1 month ago
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
Advertisement
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.

This topic is closed to new replies.

Advertisement