Share via


CCommandBar::Create

Instantiates a new command bar.

BOOL CommandBar::Create(
    CWnd* pWndParent, 
    DWORD dwStyle,
    UINT nBarID = AFX_IDW_TOOLBAR
);

Parameters

The following table describes the parameters for the Create method of the CCommandBar Class.

  • pWndParent
    A pointer to the parent of the command bar object.

  • dwStyle
    Optional parameter. Specifies the command-bar style. The following styles are supported:

    • WS_CHILD

    • WS_VISIBLE

    • CBRS_ALIGN_TOP | CBRS_BORDER_BOTTOM

  • nBarID
    Optional parameter. Specifies the child-window ID of the toolbar = AFX_IDW_TOOLBAR.

Return Values

true if successful; otherwise, false.

Remarks

The Create function creates an empty command bar. On Pocket PCs and Smartphones, the command bar is created at the bottom of the window. In Windows CE 5.0, CDialog::m_pWndEmptyCB is no longer supported, and you control the create and insert process. Previously, this member variable was used to point to the empty CommandBar or MenuBar on Pocket PC.

Requirements

Windows CE versions 5.0 and later.

Header file: Declared in Afxext.h.

See Also

Reference

CCommandBar Methods

Other Resources

Unique MFC for Devices Classes