I added a “change font color” button to a CXTPToolBar. The code is as follows:
int PEBookmarkCtrl::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl) { switch(lpCreateControl->nID) { case ID_BKCTRL_COLOR: CXTPControlPopupColor* pPopupColor = new CXTPControlPopupColor(); CXTPPopupBar* pColorBar = (CXTPPopupBar*)CXTPPopupToolBar::CreateObject(); pColorBar->GetControls()->Add(new CXTPControlButtonColor(), ID_BKCTRL_COLOR_NONE); pColorBar->GetControls()->Add(new CXTPControlColorSelector(), ID_BKCTRL_COLORSELECTOR); pColorBar->GetControls()->Add(new CXTPControlButtonColor(), ID_BKCTRL_COLOR_MORE); pPopupColor->SetCommandBar(pColorBar); pColorBar->EnableCustomization(FALSE); pColorBar->InternalRelease(); lpCreateControl->pControl = pPopupColor; return TRUE; } return FALSE; }
After changing the icon to an SVG, an assertion started occurring.
It happens when CXTPControlPopupColor::SetColor() is called in the ON_UPDATE_COMMAND_UI handler (see attached).
What should I do to fix this?
