Link to home
Start Free TrialLog in
Avatar of pcasxd0
pcasxd0

asked on

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?
Avatar of vachooho
vachooho
Flag of United States of America image

why?
Avatar of pcasxd0
pcasxd0

ASKER

I want to close a view and then open it again. For opening this view again, I need the doc.
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.
Avatar of pcasxd0

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of RONSLOW
RONSLOW

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pcasxd0

ASKER

Adjusted points from 100 to 200
Avatar of pcasxd0

ASKER

Thanks. That did the trick.