Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

CView OnUpdate behaviour

$
0
0

I have an MDI app. In CChildFrame I have an CPaneDialog from where I want to update the view, like that:

void CChildFrame::OnBnClickedButtonUpdate()
{
	// TODO: Add your control notification handler code here
	CDocument* pDoc = GetActiveDocument();
	if(NULL != pDoc)
		pDoc->UpdateAllViews(GetActiveView(), DCM_UPDATE);
}

in CMyView I have:

void CMyView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
	// TODO: Add your specialized code here and/or call the base class
	if(DCM_UPDATE == lHint)
	{
		CWaitCursor Wait;
		// some code		}
	}
}

but CMyView::OnUpdateis never been called if is launched fromCChildFrame::OnBnClickedButtonUpdate() .... why ?

But if I call:

void CChildFrame::OnBnClickedButtonUpdate()
{
	// TODO: Add your control notification handler code here
	CDocument* pDoc = GetActiveDocument();
	if(NULL != pDoc)
		pDoc->UpdateAllViews(NULL, DCM_UPDATE);
}

then CMyView::OnUpdate is called, but every view attached by the document is called, and I don't want that ...

 


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>