Condividi tramite


CMFCBaseTabCtrl::CreateWrapper

Creates a wrapper for a frame window that is derived from the CWnd Class but is not derived from the CDockablePane Class.

virtual CWnd* CreateWrapper(
   CWnd* pWndToWrap,
   LPCTSTR lpszTabLabel,
   BOOL bDetachable 
);

Parameters

  • [in] pWndToWrap
    A pointer to the frame window that is wrapped.

  • [in] lpszTabLabel
    A string that contains the label for the window.

  • [in] bDetachable
    A Boolean parameter that indicates whether the window is detachable.

Return Value

A pointer to wrapper derived from the CDockablePane class if CreateWrapper successfully creates a wrapper class for pWndToWrap. If the method fails, it retruns pWndToWrap.

Remarks

A tabbed window can dock any object derived from CWnd. However, in order for a CMFCBaseTabCtrl Class object to be dockable, each object on the CMFCBaseTabCtrl must be detachable. Therefore, CMFCBaseTabCtrl automatically wraps any objects that are not derived from CDockablePane.

By default, the CMFCBaseTabCtrl creates instances of the CDockablePaneAdapter Class. To change the wrapper's default class, call CMFCBaseTabCtrl::SetDockingBarWrapperRTC.

If pWndToWrap is derived from CDockablePane, this method will not create a wrapper. Instead, it will fail and return pWndToWrap.

Requirements

Header: afxbasetabctrl.h

See Also

Reference

CMFCBaseTabCtrl Class

Hierarchy Chart

CDockablePane Class

CMFCBaseTabCtrl::SetDockingBarWrapperRTC

CDockablePaneAdapter Class