Condividi tramite


CMFCOutlookBar::Create

Creates the Outlook bar control.

virtual BOOL Create(
   LPCTSTR lpszCaption,
   CWnd* pParentWnd,
   const RECT& rect,
   UINT nID,
   DWORD dwStyle,
   DWORD dwControlBarStyle=AFX_CBRS_RESIZE,
   CCreateContext* pContext=NULL 
);

Parameters

  • [in] lpszCaption
    Specifies the window caption.

  • [in] pParentWnd
    Specifies a pointer to a parent window. It must not be NULL.

  • [in] rect
    Specifies the outlook bar size and position in pixels.

  • [in] nID
    Specifies the control ID. Must be distinct from other control IDs used in the application.

  • [in] dwStyle
    Specifies the desired control bar style. For possible values, see Window Styles.

  • [in] dwControlBarStyle
    Specifies the special library-defined styles.

  • [in] pContext
    Create context.

Return Value

Nonzero if the method is successful; otherwise 0.

Remarks

You construct a CMFCOutlookBar object in two steps. First call the constructor, and then call Create, which creates the outlook bar control and attaches it to the CMFCOutlookBar object.

See CBasePane::CreateEx for the list of the available library-defined styles to be specified by dwControlBarStyle.

Example

The following example demonstrates how to use the Create method of the CMFCOutlookBar class. This code snippet is part of the Outlook Multi Views sample.

   CMFCOutlookBar          m_wndShortcutsBar;


...


    // int nInitialWidth 
    // CString strCaption 
    if (!m_wndShortcutsBar.Create (strCaption, this, 
        CRect (0, 0, nInitialWidth, nInitialWidth), 
        ID_VIEW_OUTLOOKBAR, WS_CHILD | WS_VISIBLE | CBRS_LEFT))
    {
        TRACE0("Failed to create outlook bar\n");
        return FALSE;      // fail to create
    }

Requirements

Header: afxoutlookbar.h

See Also

Reference

CMFCOutlookBar Class

Hierarchy Chart