Advertisement

Stupid Question

Started by May 22, 2001 04:50 PM
3 comments, last by GaMe wIg 23 years, 8 months ago
When I execute my WIN32 program (C++), the window shows for approximatly .5 seconds and then it closes. What''s up with that?!
Finally an accurately titled thread!

Anyway, if your window is going away, it sounds like your app is probably exiting. It''s impossible to say without seeing the code, but maybe you are just running right through WinMain() and exiting?

Advertisement
Sorry, the code can be viewed here:
"http://www.angelfire.com/games3/gamewig/code.txt"
You need to go into a while loop, once you have created a window:

bool finished;
while(!finished)
{
if(PeekMessage(&message, NULL, 0, 0, PM_REMOVE))
{
if(message.message == WM_QUIT)
{
finished = true;
break;
}
TranslateMessage(&message);
DispatchMessage(&message);
}
}

Alright!!!

No you don''t, but I figured out my mistake, thanks.

This topic is closed to new replies.

Advertisement