Doh! That's what I missed. A range was specified rather than a separate
message map entries for each ID.
Yup, makes sense now. :-)
See my other post for my solution to adding icons to menu commands.
"Jonathan Wood" <jwood@softcircuits.com> wrote in message
news:%23uySUonKJHA.468@TK2MSFTNGP06.phx.gbl...
"Bogdan" <bogdan@company.com> wrote in message
news:%23fc6WjnKJHA.4280@TK2MSFTNGP04.phx.gbl...
Well, there you go. If I add a menu or toolbar command, an ID of the
proper range is generated for me. As now confirmed by you, if I use a
#define with the improper value, then I'll have problems.
Please see below. If the answer does not solve your problem then please
explain what you mean by 'problems' and let me know ID value(s) that you
#defined manually in your resource.h.
All the ribbon element IDs: ID_RIBBON_BTN_1, ID_RIBBON_BTN_2,
ID_RIBBON_BTN_3, etc. I search my entire project and don't see these used
in any ON_COMMAND macros. (I appreciate you taking time to look though.)
In the sample's MainFrm.cpp there is a following line in
BEGIN_MESSAGEMAP():
ON_COMMAND_RANGE(ID_RIBBON_A, ID_RIBBON_Z, OnDummy)
The OnDummy handler takes care of IDs from 32853 to 33000.
ID_RIBBON_BTN_1 is defined as 32855.
Comment out the above line in the sample and you'll see that buttons will
stay disabled.
Bogdan