Solved

keeping doc open when last frame closes

Posted on 2000-04-12
7
147 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 …
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

13 Experts available now in Live!

Get 1:1 Help Now