Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtToolControlBar in a CView Collapse All
Subject Author Date
Olaf Reusch Jun 15, 2007 - 7:49 PM

I have a CView with a CExtToolControlBar in their. Now i have the Problem, that all ON_COMMAND and ON_UPDATE_COMMAND_UI handler which i declare are not work. The message handler are declared in CView class. What i have forgot?

Olaf Reusch Jun 17, 2007 - 4:57 PM

Ok, problem is fixed. The problem was, that only the active view receive the messsages, but we have more views in splits and the disabled splits are not received this messages.

Olaf Reusch Jun 17, 2007 - 3:01 PM

Only when the view is active, then the toolbar controls colored, when i click on a other view, the toolbar grey

Olaf Reusch Jun 17, 2007 - 1:26 PM

But why works the command routing on a click of the cview? Only the first view is wrong, then when i click everywhere in the cview the toolbar looks good and works great.

Olaf Reusch Jun 17, 2007 - 6:52 AM

Thanks i have found my problem. The mainframe was created after the clientviews. Now, i have one little problem. The toolbar buttons are grey, but not disabled. When i click on the cview, then are colored and works. Any idea, why the buttons grey on first load and changed by a click?

Technical Support Jun 17, 2007 - 12:01 PM

Your report indicates exactly the following: command routing does not work properly in your project. A similar problem occurs when using toolbars and menus in MFC regular DLL projects such as OCX projects where the MFC host does not control the thread message loop and idle command updating should be implemented periodically on timer. If you have a valid subscription, you can send us your project so we can find out what’s wrong.

Olaf Reusch Jun 15, 2007 - 8:47 PM

I have tried to ways, but i dont know, if are the right way. I make a call of UpdateFromToolbar at Mainframe init or i create a new profile with new name on create CView. Is this realy the right way? It works, but is not very nice. How i can use ProfileAddWnd? When i try to call ProfileAddWnd then i receive a exception.

Technical Support Jun 16, 2007 - 12:04 PM

You could make your view window and all its children toolbars working in their standalone command profile in the command manager but it is not the source of the problem. The problem is in the command routing in your project and this is not related to the command manager. The toolbar window sends command messages and command updating queries to its owner window -- not to its parent window. By default, the owner window is set to NULL and the parent window is used. Please try to specify the toolbar’s owner window explicitly:

pToolBar->SetOwner( pView )