Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Activate frame while it's hidden.

Posted on 1998-10-02
6
Medium Priority
?
408 Views
Last Modified: 2013-11-20
I use one document sharing with multiple views. I want to keep the document open when I close all the views, so I have one hidden frame to do the job; because it's hidden, it's not active so then when I close all the other views, all the toolbar buttons cannot function. How can I activate the hidden frame while it's hidden? or if I can't, is there any way I can keep the document open while I close all the views?  Thank you very much for your suggestion.
Tam Ngo,
0
Comment
Question by:tamngo
[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
  • 3
  • 3
6 Comments
 
LVL 3

Accepted Solution

by:
danny_pav earned 200 total points
ID: 1322887
modify your doctemplate .
It will need to keep a pointer to your viewless document.
Then when the last view is closed, before it closes (and destroys its doc) set a flag in the doc which tells it to destroy itself to FALSE. (I can find the flag for you, but I don't have docs available right now.)  Then you will also need to do something with this doc.  When you create a new view, you will have to prevent a new doc from being created and associate the saved doc with it.  And you will have to have a way to destroy the doc when the app closes.

An alternative which will keep the toolbar buttons active is to move the handlers (menu handlers with the same ID as the toolbar button) to either the mainframe or the app.  If it should seem like there is no document, why should the user be able to do operations on a document?


0
 

Author Comment

by:tamngo
ID: 1322888
Hi danny_pav,

The first part is not clear to me.  I also get the pointer to the viewless doc. When the last view is destroyed, what do I have to do with the flag (FALSE) in the doc?  it hasn't called OnCloseDocument() until I close the application.
Please give me more information.
The reason why I should keep the doc open when I close all the views is that I need other operation without the views existence.
0
 
LVL 3

Expert Comment

by:danny_pav
ID: 1322889
this is MDI correct? then you can have multiple views to one document.

from MFC code
void CDocument::OnChangedViewList()
{
      // if no more views on the document, delete ourself
      // not called if directly closing the document or terminating the app
      if (m_viewList.IsEmpty() && m_bAutoDelete)
      {
            OnCloseDocument();
            return;
      }

      // update the frame counts as needed
      UpdateFrameCounts();
}

Obviously, you want to set m_bAutoDelete to FALSE.  This will prevent the doc from being closed when the last view is closed.

Also, on 2:  Are these operations document operations or could they just be moved to the application class?
0
Industry Leaders: 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!

 

Author Comment

by:tamngo
ID: 1322890
Hi danny_pav,

The first part is not clear to me.  I also get the pointer to the viewless doc. When the last view is destroyed, what do I have to do with the flag (FALSE) in the doc?  it hasn't called OnCloseDocument() until I close the application.
Please give me more information.
The reason why I should keep the doc open when I close all the views is that I need other operation without the views existence.
0
 
LVL 3

Expert Comment

by:danny_pav
ID: 1322891
1.  Is this MDI?
2.  What operations are being done to a viewless document?
0
 

Author Comment

by:tamngo
ID: 1322892
I think I've got it.  Because I still have one viewless frame, it doesn't call OnCloseDocument() when I close all visible views.
If I want to activate buttons just move handlers to mainframe instead of keeping them at CDoc.  I just wonder why are the handlers are inactive when the doc still open.
Thank you very much for your time.


0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

618 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