Article ID: 111768
Article Last Modified on 11/21/2006
CDialogBar CToolBar CStatusBar
/* Compile options needed: None
Sample 1 - Override OnCreate.
Note that the dialog template is called IDD_CHILDBAR
and that CMyMDIChild has a member variable declaration:
CDialogBar m_dlgbar;
*/
int CMyMDIChild::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
m_dlgbar.Create(this,IDD_CHILDBAR,CBRS_TOP,115);
return 0;
}
/*
Sample 2 - Creating a dialog bar at any time.
Note that the dialog template is called IDD_CHILDBAR
and that CMyMDIChildWnd has a member variable declaration:
CDialogBar *m_pdlgbar;
*/
void CMyMDIChild::CreateDialogBar()
{
m_pDlgBar = new CDialogBar();
m_pDlgBar->Create(this,IDD_CHILDBAR,CBRS_TOP,115);
RecalcLayout();
}
Because you are allocating a CDialogBar object, you need to call delete
m_pDlgBar when you close the application or there will be a memory leak.
Additional query words: WM_SIZE CRect tool bar status tool-bar status-bar statusbar
Keywords: kbmfcctrlbar kbprb kbtoolbar kbuidesign KB111768