15,979
社区成员
发帖
与我相关
我的任务
分享
int CMainFrame::AddView(CCreateContext *pContext)
{
CView* f_pView = NULL;
//最多支持255个视类对象,m_arViewPointer是数组,保存添加的视类个数
if(m_arViewPointer.GetSize() >= 255)
return -1;
//检查入口参数有效性
if (pContext != NULL && pContext->m_pNewViewClass != NULL)//这里因pContext为NULL,退出
...
}
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
int f_iFirstView;
int f_iSecondView;
f_iFirstView = AddView(pContext);
if(f_iFirstView < 0)
return FALSE;
//////////////////////////////////////////////////////////////////////*/
//在此处添加地图显示视图
pContext->m_pNewViewClass = RUNTIME_CLASS(CMapView);
f_iSecondView = AddView(pContext);
//SetTopView函数显示视图的切换功能,设置当前显示视类
SetTopView(f_iSecondView);
// m_iTopView=0;
return TRUE; //这里不该这样退出
}