?
Solved

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

Posted on 2004-10-13
2
Medium Priority
?
368 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
[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
2 Comments
 
LVL 12

Accepted Solution

by:
OnegaZhang earned 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

770 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