Dear all,

In my app, I needs a commandbar with menu and toolbar. So I write the
following code:

bool CMainDlg::initToolbar()
{

if (!m_wndCommandBar.Create(this) ||
!m_wndCommandBar.InsertMenuBar(IDR_MENU1) ||
!m_wndCommandBar.AddAdornments(dwAdornmentFlags) )
{
TRACE0("Failed to create CommandBar\n");
return false; // fail to create
}

CBitmap imageList;
CBitmap imageMask;
imageList.LoadBitmapW(IDB_TOOLBAR);
imageMask.LoadBitmapW(IDB_TOOLBAR_MASK);
VERIFY(m_toolbarImageList.Create(16,16,ILC_MASK,20,2));
m_toolbarImageList.Add(&imageList,&imageMask);

CToolBarCtrl& toolbar=m_wndCommandBar.GetToolBarCtrl();
toolbar.SetImageList(&m_toolbarImageList);

TBBUTTON buttons[7];
buttons[0].iBitmap=0;
buttons[0].idCommand=ID_CALL;
buttons[0].fsStyle=TBSTYLE_BUTTON;
buttons[0].fsState=TBSTATE_ENABLED;
buttons[0].iString=-1;

buttons[1].iBitmap=1;
buttons[1].idCommand=ID_DISCONNECT;
buttons[1].fsStyle=TBSTYLE_BUTTON;
buttons[1].fsState=TBSTATE_ENABLED;
buttons[1].iString=-1;

buttons[2].iBitmap=0;
buttons[2].idCommand=0;
buttons[2].fsStyle=TBSTYLE_SEP;
buttons[2].fsState=TBSTATE_ENABLED;
buttons[2].iString=-1;

buttons[3].iBitmap=2;
buttons[3].idCommand=ID_CALL_MODE;
buttons[3].fsStyle=TBSTYLE_BUTTON;
buttons[3].fsState=TBSTATE_ENABLED;
buttons[3].iString=-1;

buttons[4].iBitmap=3;
buttons[4].idCommand=ID_TOOLS_TOOLS3;
buttons[4].fsStyle=TBSTYLE_BUTTON;
buttons[4].fsState=TBSTATE_ENABLED;
buttons[4].iString=-1;

buttons[5].iBitmap=0;
buttons[5].idCommand=0;
buttons[5].fsStyle=TBSTYLE_SEP;
buttons[5].fsState=TBSTATE_ENABLED;
buttons[5].iString=-1;

buttons.iBitmap=4;
buttons.idCommand=ID_MISS_CALL;
buttons.fsStyle=TBSTYLE_BUTTON;
buttons.fsState=TBSTATE_ENABLED;
buttons.iString=-1;

toolbar.AddButtons(7,buttons);

m_wndCommandBar.SetBarStyle(m_wndCommandBar.GetBarStyle() | CBRS_SIZE_FIXED);

m_wndCommandBar.Show(TRUE);
return true;
}


But when m_wndCommandBar.Show(TRUE) is called, the output window displays
Data Abort information. What's wrong?
Thank you in advance!