I have added to my program a ComboBox in the toolbar using the MFC Feature pack. I have been success with it and it is working. The text options in the ComboBox must change according external factors, so when you run the problems they could be "Option #1", "option #2", etc or "Option A", "Option B", etc.
My problem is the program reads the content of the CMFCToolBarComboBoxButton from the registry always brings the last set of options, despite I loaded a diferent one when I created the CMFCToolBarComboBoxButton and did the ReplaceButton.
If I delete the registry it works fine the first time, but the second time loads again the previous set of texts.
Is there any way to disable this feature ? I haven´t found any help out there
I have also checked with the VisualStudioDemo example program included in the VS2010 and I had the same result. I change the text of teh lines and it doesn´t show up at the combobox until I reset the toolbar.
Any help will be very welcomed
Thank you
What I have tried:
This is a resume of my code
{
...
CMFCToolBarComboBoxButton comboButton( ID_DESTINOS, GetCmdMgr()->GetCmdImage(ID_DESTINOS, FALSE), CBS_DROPDOWNLIST);
if( Set() == 1)
{
comboButton.AddItem( _T("OPTION #1"));
comboButton.AddItem( _T("OPTION #2"));
}
else
{
comboButton.AddItem( _T("Diferent #A"));
comboButton.AddItem( _T("Diferent #B"));
}
comboButton.SelectItem( 0);
m_wndToolBar.ReplaceButton( ID_DESTINOS, comboButton);
...
}