Advertisement

is this normal?

Started by November 05, 2001 11:33 AM
2 comments, last by da_cobra 23 years ago
is this normal that after my program has initialized it quits? while (TRUE) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message==WM_QUIT) // Have We Received A Quit Message? { // If So break break; } else { TranslateMessage(&msg) ; DispatchMessage(&msg) ; } // end of else } // end of if else { GameMain() ; } } // end of while GameMain() { } as you can see there is nothing in my gamemain function is this the reason that my program immediatly quits? thanx in advance for any help
for some reason, msg.message = WM_QUIT... I don''t know why, but you have to figure that part out... might want to change that to..


while (PeekMessage(&msg, etc, etc)....
Advertisement
If you''re in fullscreen mode, windows sometimes doesn''t display the access violation message box, even if an access violation has occured.

So maybe there is an access violation in your GameMain() function, which causes the immediate exit of your program. I would say, remove the GameMain() function call, and see if it works after that.
Yeah, I''d try what Nick says. Looking at just that piece, I don''t think the program should end. If the while loop is always true (and it should be in this case, right?) it should just keep looping, regardless of GameMain(). Try commenting that out though, and then try.

Oh another thing I just thought about was that (at least on my compiler) when you right "true" it must be in lower case; yours is in caps. If that was the case, the loop would never execute, I think. Again, just an observation but you could try it
Peon

This topic is closed to new replies.

Advertisement