Print Page | Close Window

CanCloseFrame() never calls SaveModified()

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=19641
Printed Date: 18 June 2025 at 1:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CanCloseFrame() never calls SaveModified()
Posted By: alan.f.rice
Subject: CanCloseFrame() never calls SaveModified()
Date Posted: 05 April 2012 at 4:01pm
In 2010 my partner and I embarked on a major upgrade to our VC++ code suite, that included upgrading from VS6 to VS2010 and from CJ 6.0 to ToolkitPro 13.42.

We are having a problem where, when the user exits the main application, CFrameWnd::OnClose() will call CanCloseFrame(pFrame) in doccore.cpp, which loops through each open CView *pView.  While inside the pView loop gets the parent frame,

     CFrameWnd* pFrame = pView->GetParentFrame()

and checks to see if there are any document windows still active within the frame: 

if (pFrame->m_nWindow > 0)
      return TRUE;     // more than one frame referring to us

There are several views with frames that have 1 or 2 documents, so the return is executed and the program exits fully without ever reaching the last line in CanCloseWindow() which is SaveModified().

Now, I'm not certain this problem manifested with the move from CJ60 to ToolKitPro, but we have had several other shutdown issues we have had to rework our code for and so there is an element of suspicion.

Anyone have any insight into this?

Thanks,

Al



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