|Date:||September 18, 2006 / year-entry #316|
|Summary:||Why does my MFC program exit unexpectedly? The stack trace at the point we hit ExitInstance goes like this: CClientConsoleApp::ExitInstance CWinThread::Run+0x88 AfxWinMain+0x84 _wWinMainCRTStartup+0x138 BaseThreadInitThunk+0xe _RtlUserThreadStart+0x23 Thanks. You can already see some of what's going on, but clearly more information is needed. My first psychic suggestion was to examine MFC's message pump to see what causes...|
You can already see some of what's going on, but clearly more information is needed. My first psychic suggestion was to examine MFC's message pump to see what causes it to exit. Then follow the money backwards.
MFC comes with source code so you can do this yourself. Don't expect somebody to do your debugging for you. You have the tools to do it yourself: You have the source code and you have a brain.
Once you figure out what conditions make MFC's message pump exit, then try to figure out which of those conditions is actually occurring, and then set breakpoints to try to catch the condition being achieved.
I don't have the MFC source code memorized and I didn't feel like installing it just to help somebody solve their own problem, so I resorted to wild guessing in the guise of psychic powers:
(Sorry, I can't finish up this story with a snappy ending. It happened so long ago I forget what the problem was.)
<-- Back to Old New Thing Archive Index