Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3027

A CMFCDropDownToolBar Question

$
0
0
I created a CMFCDropDownToolBar embedded in a CMFCToolBar VIA dummy resource button as explained in CMFCDropDownToolBar Class microsoft document,everything works great, but what I want to do is create another dropdown toolbar embedded in the CMFCDropDownToolBar, is this possible??? I would like the same appearance look of the same toolbar/buttons as the 3rd choice of commands, I tried using the same process this time embedding a CMFCDropDownToolBar in a CMFCDropDownToolBar , it compiled but I got a debug assertion at the line using replacebutton


THIS WORKS
Code:

CMFCToolBar m_wndTB;
CMFCDropDownToolBar m_wndTBM;


afx_msg LRESULT CMainFrame::OnResetToolbar(WPARAM wParam, LPARAM lParam)
{.
.
.
 m_wndTB.ReplaceButton(IDB_DUMMY_TBAR, CMFCDropDownToolbarButton(_T("Add TB"), &m_wndTBM));
}

void CMainFrame::OnViewCustomize()
{.
.
.

pDlgCust->AddButton(_T("Build"), CMFCDropDownToolbarButton(_T("Add Resource"), &m_wndTBM));
}


ReplaceButton THROWS A DEBUG ASSERTION
Code:

CMFCDropDownToolBar m_wndTBMode,m_wndTB2;


afx_msg LRESULT CMainFrame::OnResetToolbar(WPARAM wParam, LPARAM lParam)
{.
.
.
 m_wndTB2.ReplaceButton(IDB_DUMMY_TBAR2, CMFCDropDownToolbarButton(_T("Add TBMode"), &m_wndTBMode));
}

void CMainFrame::OnViewCustomize()
{.
.
.

pDlgCust->AddButton(_T("Build"), CMFCDropDownToolbarButton(_T("Add Resource"), &m_wndTBMode));
}


Viewing all articles
Browse latest Browse all 3027

Latest Images

Trending Articles



Latest Images