Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - App Doesn't close!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

App Doesn't close!

 Post Reply Post Reply
Author
Message
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Topic: App Doesn't close!
    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?
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 December 2006 at 9:52am
Hi,
Check if CWinApp::ExitInstance was called.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Posted: 12 December 2006 at 10:06am

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

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 12 December 2006 at 1:56pm
Hi,
Set breakpoint in MFC's CWinApp::ExitInstance
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.