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?
pcasxd0Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
RONSLOWConnect With a Mentor Commented:
set m_bAutoDelete = false for the document.

then it will not be deleted when the (last) view is shut.
0
 
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
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.

 
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
 
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
 
pcasxd0Author Commented:
Adjusted points from 100 to 200
0
 
pcasxd0Author Commented:
Thanks. That did the trick.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.