Window Closing Problem

Started by
1 comment, last by Peon 21 years, 11 months ago
This is a problem I''ve been having, with a variety of programs I''ve been writing recently (VC++ 6.0; Windows programs) When I go to close the window, it closes fine, but then when I try and compile again, it tells me there is some sort of linker error. It took me awhile, but I figured out that it meant the program is still running... except, it looks closed. Ctrl+alt+delete, however, reveals that it is still running. Without seeing any code, does anyone know what is causing this? I''m guessing that I''m missing the WM_DESTROY or whatever that message is and if that''s the case, I''ll just go through my code again and find out why. I just wanted to see if this is what the problem likely is though, before I go wasting my time
Peon
Advertisement
The compiler cannot alter the exe file because your program is still running. This is because the message loop (in your WinMain function) is not exited. You can exit this loop by sending a WM_QUIT message to the window when the window is being destroyed.

(put this inside your window procedure)
switch(message)..case WM_DESTROY:   PostQuitMessage(0);   return 0;.. 
Ooh okay, well, I was aware that that was the problem (why I couldn''t write to exe) and it looks like I was right about missing a message. Thanks for confirming that
Peon

This topic is closed to new replies.

Advertisement