Ok so I've got this as my message handler:
LRESULT CALLBACK CWin::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
and this as my message pump:
void CWin::appLoop()
{
MSG msg;
while (GetMessage(&msg, m_hWnd, 0 , 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
When I close the window I still have to manually stop the program from the debugger menu. If I step through after the window's closed I get an error stating: "There is no source code available for the current location.", and stepping through clearly shows it passing through PostMessageQuit(0) and falling out of the function block. Any ideas? Thanks.
[Edited by - BigFreak on March 2, 2006 10:42:09 AM]