Solved

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

Posted on 2004-10-13
2
316 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

19 Experts available now in Live!

Get 1:1 Help Now