my exe appears in task manager after closing.
-
Hi all, I have a dialog based application in MFC using visual studio 2005. After I close the application, in CTestMainFrame::OnClose(), I am doing PostQuitMessage( 0); With this the dialog box closes but my application still exists in Windows task manager. Can you please help is there any other way I can kill my app completely.
Regards, Sunil.
-
Hi all, I have a dialog based application in MFC using visual studio 2005. After I close the application, in CTestMainFrame::OnClose(), I am doing PostQuitMessage( 0); With this the dialog box closes but my application still exists in Windows task manager. Can you please help is there any other way I can kill my app completely.
Regards, Sunil.
To close a modal dialog (the main dialog of a dialog based application is a modal dialog), call one of the
EndDialog()
,OnOK()
, orOnCancel()
member functions ofCDialog
. This will perform all necessary cleanup, close the dialog and return toInitInstance()
of your application. The application is then terminated by returningFALSE
fromInitInstance()
. -
Hi all, I have a dialog based application in MFC using visual studio 2005. After I close the application, in CTestMainFrame::OnClose(), I am doing PostQuitMessage( 0); With this the dialog box closes but my application still exists in Windows task manager. Can you please help is there any other way I can kill my app completely.
Regards, Sunil.
Calling PostQuitMessage(0) should do the job but somewhere your application is buggy for sure, you have to check out all deinitialization code in your app. You put some buggy code to a destructor or a function called by mfc or by one of your own destructors during program shutdown that doesn't work as intended. Run the program in a debugger and if you can reproduce the bug in while debugging then try to check out what is goin on in your program by pressing the pause button in the debugger. Check out the callstack of all threads, especially that of the Main thread.
-
Hi all, I have a dialog based application in MFC using visual studio 2005. After I close the application, in CTestMainFrame::OnClose(), I am doing PostQuitMessage( 0); With this the dialog box closes but my application still exists in Windows task manager. Can you please help is there any other way I can kill my app completely.
Regards, Sunil.
Why did you replace CDialog::OnClose(); given you by the wizzard with PostQuitMessage()? You HAVE to allow the base class to function correctly.
-
Calling PostQuitMessage(0) should do the job but somewhere your application is buggy for sure, you have to check out all deinitialization code in your app. You put some buggy code to a destructor or a function called by mfc or by one of your own destructors during program shutdown that doesn't work as intended. Run the program in a debugger and if you can reproduce the bug in while debugging then try to check out what is goin on in your program by pressing the pause button in the debugger. Check out the callstack of all threads, especially that of the Main thread.
Dont liaten to this guy, he is an idiot. Calling PostQuitMessage from you OnClose handler is goin to do what?