I'm looking at methods_output.cpp, and there's something I'm not getting.
CMUSHclientDoc::Redraw() just calls UpdateAllViews(NULL).
And
CMUSHclientDoc::Repaint() does...
Which is oddly similar to a combination of Redraw() and this example code for CDocument::GetFirstViewPosition (MFC) from http://msdn.microsoft.com/en-us/library/ysfkkk2h%28VS.80%29.aspx
Notice that comment at the bottom. MSDN appears to be claiming that Repaint() is just like calling Redraw() twice, with the minor difference of your CMUSHView pointer shuffling (what is that for?).
Indeed, the example code for CDocument::UpdateAllViews (MFC) from http://msdn.microsoft.com/en-us/library/eys41xfw%28VS.80%29.aspx is
Which is the same function declaration as above. So what's going on here?
CMUSHclientDoc::Redraw() just calls UpdateAllViews(NULL).
And
CMUSHclientDoc::Repaint() does...
UpdateAllViews (NULL);
for(POSITION pos = GetFirstViewPosition(); pos != NULL; )
{
CView* pView = GetNextView(pos);
if (pView->IsKindOf(RUNTIME_CLASS(CMUSHView)))
{
CMUSHView* pmyView = (CMUSHView*)pView;
pmyView->UpdateWindow ();
} // end of being a CMUSHView
} // end of loop through views
// This example uses CDocument::GetFirstViewPosition
// and GetNextView to repaint each view.
void CMyDoc::OnRepaintAllViews()
{
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
pView->UpdateWindow();
}
}
// An easier way to accomplish the same result is to call
// UpdateAllViews(NULL);
Indeed, the example code for CDocument::UpdateAllViews (MFC) from http://msdn.microsoft.com/en-us/library/eys41xfw%28VS.80%29.aspx is
void CMyDoc::OnRepaintAllViews()
{
UpdateAllViews(NULL);
}