Print Page | Close Window

App Doesn't close!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5765
Printed Date: 11 November 2025 at 8:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: App Doesn't close!
Posted By: ContactGT
Subject: App Doesn't close!
Date Posted: 12 December 2006 at 8:10am
I am having trouble figuring out why my application won't close! I have overridden the CMainFrame::OnClose() method, but I only save my toolbar info and view info to the registry then pass on the call to CXTPMDIFrameWnd::OnClose(); This code all runs just fine. The application window closes, but the application remains on the task list and I have to kill it manually - same in debug mode - everything seems to close just fine, but I have to press the Stop Debugging button to close the application.
 
Anyone know what do I need to step into to figure out what is failing - there is nothing added to the Output window during close?
 



Replies:
Posted By: Oleg
Date Posted: 12 December 2006 at 9:52am
Hi,
Check if CWinApp::ExitInstance was called.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ContactGT
Date Posted: 12 December 2006 at 10:06am

ExitInstance is nowhere in my code - where should I call CWinApp::ExitInstance()? In the MainFrame::OnClose()?



Posted By: Oleg
Date Posted: 12 December 2006 at 1:56pm
Hi,
Set breakpoint in MFC's CWinApp::ExitInstance


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ContactGT
Date Posted: 12 December 2006 at 2:41pm
The breakpoint is never hit, so this method is never called. I don't have to call this method in my other applications, so any idea why this might be hapenning here?


Posted By: Oleg
Date Posted: 13 December 2006 at 1:16am
Hi,
I think CMainFrame never destroyed.... try also set breakpoint in destructor of CMainFrame. May be you have some exception or something... Impossible to say without code.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ContactGT
Date Posted: 13 December 2006 at 5:14am
Thank you for your help. Problem was that in the Document I had added a  AfxOleLockApp() call, but I forgot to AfxOleUnlockApp()! All OK now



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net