Solved

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

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 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