//获取主框架 CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; // Get the active MDI child window. CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame(); // or CMDIChildWnd *pChild = pFrame->MDIGetActive(); // Get the active view attached to the active MDI child // window.CDisplayModeView是你定义的 CDisplayModeView *pView=(CDisplayModeView *) pChild->GetActiveView(); if(pView) { //刷新 pView->Invalidate(TRUE); }
CMDIFrameWnd *pFrame =
(CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; // Get the active MDI child window.
CMDIChildWnd *pChild =
(CMDIChildWnd *) pFrame->GetActiveFrame(); // or CMDIChildWnd *pChild = pFrame->MDIGetActive(); // Get the active view attached to the active MDI child
// window.CDisplayModeView是你定义的
CDisplayModeView *pView=(CDisplayModeView *) pChild->GetActiveView();
if(pView)
{
//刷新
pView->Invalidate(TRUE);
}