CStatusBar & CToolBar in a CReBar on a modeless dialog and ON_UPDATE_COMMAND_UI
Posted on 2002-04-29
My app is an ATL COM EXE server (out-of-proc) with MFC support added in. I have an invisible main window, whose main purpose in life is to provide the app's message pump.
I also have a modeless dialog which is the application's primary window. On this dialog I have a CReBar, and in the CReBar are 2 bands; a CToolBar and a CStatusBar.
I would like to use MFC's ON_UPDATE_COMMAND_UI mechanism to update both the enabled-state of the buttons in the toolbar and the indicators of the status bar, but I can't get it to work. My ON_UPDATE_COMMAND_UI handlers for the individual controls (example, the button in the toolbar) are never called in the controlbar. The update-handlers are fired in the dialog class for the dialog's menubar, but they are not fired in the CReBar or CStatusBar or CToolBar classes.
I am using the technique outlined in 'MFC Answer Book' FAQ # 6.10 and FAQ # 4.8, but it's not working as advertised.
Could anyone shed any light on this for me? Has anyone else done something like what I am doing?
Thanks for the use of your brain.