I have a CBCGToolbarMenuButton (that has a drop-down menu). I don't want the button to do anything but drop-down this menu. In other words, it shouldn't have a default command if you press the icon part.
So, when I built the button, I set the command ID to -1, which is legal.
CMenu M;
M.LoadMenu( IDM_VIEW_LAYOUT );
int image = CImageHash::GetImageOfCommand( ID_VIEW_LAYOUT );
CBCGToolbarMenuButton B( -1, *M.GetSubMenu( 0 ), image, _T( "Layout" ) );
fileBar.ReplaceButton( ID_VIEW_LAYOUT, B );
It works, but...
When I go to the "Button Appearance..." for this button, there is no default image listed and the choice is greyed out (which is different from another menu button I have with a default command).
WORSE, if I click in the dimmed image edit area, the program crashes!
Am I doing something wrong?