……
activateframe(ncmdshow);
if (pview != null)
pview->onactivateview(true, pview, pview);
}
// update frame counts and frame title (may already have been visible)
if (pdoc != null)
pdoc->updateframecounts();
onupdateframetitle(true);
}
上面的函数中对视图的操作主要是用setactiveview设置了活动视图,并且调用了视图的onactivateframe函数。在cframewnd类中维护着一个保护成员:cview* m_pviewactive;,setacitveview函数主要就是对它进行操作:
void cframewnd::setactiveview(cview* pviewnew, bool bnotify)
{
cview* pviewold = m_pviewactive;
if (pviewnew == pviewold)
return; // do not re-activate if setactiveview called more than once
m_pviewactive = null; // no active for the following processing
// deactivate the old one
if (pviewold != null)