Solved

How to Call UpdateAllViews(NULL) from within a Dialog Window

Posted on 2004-10-13
2
344 Views
Last Modified: 2013-11-20
Hi there, I have a Dialog windows ina MDI that when I click OK should call the UpdateAllViews(NULL) , I ried to get a Pinter to Maindoc:

      CMainDoc*  m_pDocument = AfxGetMainWnd()->GetActiveView()->GetDocument();
        m_pDocument->SetModifiedFlag();
        m_pDocument->UpdateAllViews(NULL);

but I keep getting an error message saying  error C2039: "GetActiveView":is not a member of "CWnd"

Could you tell me where I make a mistake??

thanks
0
Comment
Question by:rcinformatica
2 Comments
 
LVL 12

Accepted Solution

by:
OnegaZhang earned 500 total points
ID: 12298310
CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
            if(pMain)
            {
                  CFrameWnd* pFrame = pMain->GetActiveFrame();
                  if(pFrame)
                  {
                        CView* pView = pFrame->GetActiveView();
                        CDocument* pDoc = pView->GetDocument();
                        if(pDoc)
                        {
                        pDoc->SetModifiedFlag();
                        pDoc->UpdateAllViews(NULL);
                        }

                  }
            }
welcome to www.fruitfruit.com
0
 

Author Comment

by:rcinformatica
ID: 12298414
thanks it works ...

take care
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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: 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…
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…
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.

830 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