Thursday, November 10, 2005

A Simple Fix

Turns out the problem I had with setting a window procedure before calling IDirectDraw7::SetDisplayMode had to do with the way the window procedure itself was formed. Originally, I had it set up like this:


LRESULT Application::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)


Once I inserted "CALLBACK" in between "LRESULT" and "Application", everything worked fine. This is how it looks now:


LRESULT CALLBACK Application::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)


The surprising part was that the malformed window proc would work under Win98, however something about the call to IDirectDraw7::SetDisplayMode made it fail.

No comments: