Stupid Question
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! ![](wink.gif)
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?
![](wink.gif)
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?
Sorry, the code can be viewed here:
"http://www.angelfire.com/games3/gamewig/code.txt"
"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!!!
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!!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement