Skip to main content
gamedev.net
🔒 Locked

Window Loop

Started by quaker Apr 6, 2006 at 4:14 PM 5 replies 450+ views
Original Post
quaker
quaker
Why I get application error, break point reached ... when I close the program or send close message? while (1) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); } else { ..... } } Thanks.
LostSource
LostSource
How are you handling the close and destroy window messages in your win proc? I ask because your while loop looks fine to me.
CrazyCdn
CrazyCdn
Yeah your message loop is fine, I just do a while (!done) then when I hit WM_QUIT and change done to true and exit gracefully. I think its neater looking and easier to follow then a break like yours but it's looks nothing more.

What's the actual error you are getting and how are you handling, like LostSource asked, your WndProc for the close/destroy messages?
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin
quaker
quaker
Actually I handle the following message:

WM_DESTROY:
PostQuitMessage(0);


And the application error message:

The exception breakpoint
A breakpoint has been reached.
(0x80000003) occurred in the application at location 0x...

Strange!


quaker
quaker
Ya I forgot to mention it's a D3D application. when I take out the D3D code it works fine.
quaker
quaker
Ya I forgot to mention it's a D3D application. when I take out the D3D code it works fine.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.