自己生成对象,填充各必要数据成员

解决方案 »

  1.   

    BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class
    p1.CreateStatic(this,1,2);
    p1.CreateView(0,0,RUNTIME_CLASS(CDrawView),CSize(0,0),pContext);
    p2.CreateStatic(&p1,2,1,WS_CHILD|WS_VISIBLE|WS_BORDER,p1.IdFromRowCol(0,1));
    p2.CreateView(0,0,RUNTIME_CLASS(CColorView),CSize(0,0),pContext);
    p2.CreateView(1,0,pContext->m_pNewViewClass,CSize(0,0),pContext);
    //p3.CreateStatic(&p2,1,2,WS_CHILD|WS_VISIBLE|WS_BORDER,p1.IdFromRowCol(0,0));
    //p3.CreateView(0,1,RUNTIME_CLASS(CColorView),CSize(0,0),pContext);
    //p3.CreateView(0,0,RUNTIME_CLASS(CColorView),CSize(0,0),pContext);
    return TRUE;
    //return CMDIChildWnd::OnCreateClient(lpcs, pContext);
    }