Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

keeping doc open when last frame closes

When I close the last view/frame in an MDI application, the document automatically gets closed, and its destructor is called. Can I prevent this from happening?
0
pcasxd0
Asked:
pcasxd0
  • 4
  • 2
1 Solution
 
vachoohoCommented:
why?
0
 
pcasxd0Author Commented:
I want to close a view and then open it again. For opening this view again, I need the doc.
0
 
vachoohoCommented:
keep all neccessary data in the global objects (like CWinApp or CMainFrame)
then from CDocuments reach data using
AfxgetApp() or AfxGetMainWnd() calls.

you will need to load data once when opening first document then reuse it.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
pcasxd0Author Commented:
That is not the solution I want. All my data is stored in the doc and I want to access the data thru the doc. Moving it to the app or mainfrm will take some effort. I know that keeping the doc open can be done..... just don't know how.
0
 
RONSLOWCommented:
set m_bAutoDelete = false for the document.

then it will not be deleted when the (last) view is shut.
0
 
pcasxd0Author Commented:
Adjusted points from 100 to 200
0
 
pcasxd0Author Commented:
Thanks. That did the trick.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now