Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

keeping doc open when last frame closes

Posted on 2000-04-12
7
Medium Priority
?
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

705 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