Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

keeping doc open when last frame closes

Posted on 2000-04-12
7
Medium Priority
?
155 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 800 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
In this post we will learn different types of Android Layout and some basics of an Android App.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
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.

971 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