Click to See Complete Forum and Search --> : CView inside ControlBar


Andy Pattrick
May 7th, 1999, 10:34 AM
Hi, I have a CControl bar derived class (CCJControlBar from CodeGuru) which has a CView derived child window. There is a problem which occurs when the control bar is floating. If the CView is made to lose focus e.g by bringing up an About box and the About box is then closed, the main frame window enters into a strange state where you are unable to click on the main frame menu or toolbar buttons. I have established that every time you click on the menu / buttons OnActivateView gets called in the CView. It seems to me that this is wrong as the view should already be active. In fact, if the control bar is docked, OnActivateView only gets called once in the view. Has anyone else had this problem. I am convinced that the problem lies with the CMiniDockFrameWnd which becomes the CViews parent when the control bar is floating. I know for a fact that methods like CView::GetParentFrame return differently if the control bar is docked or floated.

Any ideas ??

Cheers Andy

Cristi Posea
May 7th, 1999, 02:57 PM
I don't want to discourage you - a working view on a control bar it may be possible to get. But after I dug through the MFC sources I found this to be too much trouble. My advice is to use plain CWnd derived classes for your controlbar's children.
You can read more about this in a comment posted to my article, at
http://www.codeguru.com/docking/docking_window2.shtml

Cheers,
Cristi