Solved

keeping doc open when last frame closes

Posted on 2000-04-12
7
149 Views
Last Modified: 2013-11-20
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
Comment
Question by:pcasxd0
  • 4
  • 2
7 Comments
 
LVL 5

Expert Comment

by:vachooho
ID: 2709958
why?
0
 

Author Comment

by:pcasxd0
ID: 2709962
I want to close a view and then open it again. For opening this view again, I need the doc.
0
 
LVL 5

Expert Comment

by:vachooho
ID: 2709976
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:pcasxd0
ID: 2710077
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
 
LVL 10

Accepted Solution

by:
RONSLOW earned 200 total points
ID: 2710715
set m_bAutoDelete = false for the document.

then it will not be deleted when the (last) view is shut.
0
 

Author Comment

by:pcasxd0
ID: 2712853
Adjusted points from 100 to 200
0
 

Author Comment

by:pcasxd0
ID: 2712854
Thanks. That did the trick.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now