Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

772 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