Why does the application crash now?
Steps to reproduce:
Create an Outlook-type MDI project with Ribbon user interface
. In the OnUpdate member of you CView class, add the following code:
CMFCRibbonBar *pRibbon = ((CMDIFrameWndEx*) AfxGetMainWnd())->GetRibbonBar(); CMFCRibbonButton *pBtnPrint = DYNAMIC_DOWNCAST(CMFCRibbonButton, pRibbon->FindByID(ID_FILE_PRINT)); if (pBtnPrint) pBtnPrint->RemoveAllSubItems();
↧
MFC Ribbon: CMFCRibbonButton::RemoveAllSubItems() in CView::OnUpdate leads to access violation (VS2008 + SP1 + Feature Pack)
↧