"Joseph M. Newcomer" <firstname.lastname@example.org> wrote in message
On Mon, 12 May 2008 16:55:54 -0700, "Nick Schultz" <email@example.com>
I am trying to capture the message that is sent when one of my toolbar
buttons are pressed.
I extended the CMFCToolBar class to :
class CGraphToolBar : public CMFCToolBar
I have message map set accordingly:
in the constructor, i create all my buttons (using one as an example):
m_saveBtn = new CMFCToolBarButton(IDD_TOOLBAR_SAVE,3);
I add the button in the OnCreate function:
And i have a simple handler function:
When I run the program and click the button (the button is greyed out by
way), I get this message instead:
Warning: no message line prompt for ID 0x0032.
Actually, you are creating a correlation where none exists; the two
The failure to enable would be typically be caused by your message map in
routing hiearchy (and your toolbar is not part of that hiearchy) not
having an entry for
the button, so by default it is disabled if there is no handler.
The warning is caused by exactly what it says: there is no string IDS_xxxx
value 32(the control value you have assigned the button). But this has
nothing to do with
the failure to enable.
I'm not sure what I am doing wrong, where should I be capturing this
In the message routing hierarchy. such as in your document, view,
mainframe, app, child
MDI frame, document template, etc. you need a handler. Since the toobar
is not part of
the MFC message routing scheme, a handler in it is not seen and the button
Joseph M. Newcomer [MVP]
MVP Tips: http://www.flounder.com/mvp_tips.htm