Partager via


CSplitterWnd::CreateView

Creates the panes for a static splitter window.

virtual BOOL CreateView( 
   int row, 
   int col, 
   CRuntimeClass* pViewClass, 
   SIZE sizeInit, 
   CCreateContext* pContext  
);

Parameters

  • row
    Specifies the splitter window row in which to place the new view.

  • col
    Specifies the splitter window column in which to place the new view.

  • pViewClass
    Specifies the CRuntimeClass of the new view.

  • sizeInit
    Specifies the initial size of the new view.

  • pContext
    A pointer to a creation context used to create the view (usually the pContext passed into the parent frame's overridden CFrameWnd::OnCreateClient member function in which the splitter window is being created).

Return Value

Nonzero if successful; otherwise 0.

Remarks

All panes of a static splitter window must be created before the framework displays the splitter.

The framework also calls this member function to create new panes when the user of a dynamic splitter window splits a pane, row, or column.

Example

// this function creates the panes for a static splitter window
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
   m_bSplitterCreated = m_wndSplitter.CreateStatic(this, 1, 2);
   // CMyView and CMyOtherView are user-defined views derived from CView
   m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMyView), CSize(0, 0), 
      pContext);
   m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CMyOtherView), CSize(0, 0), 
      pContext);

   return (m_bSplitterCreated);
}

Requirements

Header: afxext.h

See Also

Reference

CSplitterWnd Class

Hierarchy Chart

CSplitterWnd::Create