I have create some toolbars dynamically in my mfc application
m_cToolBarEx.CreateEx(this, TBSTYLE_FLAT , WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC | CBRS_HIDE_INPLACE);
the toolbar has no bitmap or resource id. I used the function InsertButton to add buttons in my toolbar
When I try to reset this toolbar through Reset Toolbar button from menu. The toolbar does not reset to its original state only the message box is prompted and no changes are restored.
I assume the problem is when the CMFCToolBar::RestoreOriginalstate()
is executed the condtion:
if (m_uiOriginalResID == 0)
{
return FALSE;
}
gets true and the function returns false as there is no resource id in the m_uiOriginalResID.
Is there any way to load the dynamically created toolbar or I have to inherit RestoreOriginalstate function and write my own.