Archived

This topic is now archived and is closed to further replies.

da_cobra

is this normal?

Recommended Posts

da_cobra    122
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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)....

Share this post


Link to post
Share on other sites
nickm    122
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.

Share this post


Link to post
Share on other sites
Peon    276
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

Share this post


Link to post
Share on other sites