tags:

views:

176

answers:

1

Hi,

I have created a MDI project with CView's using VS2008Pro. I want to have some sort of bar at the bottom of every CView where i can put controls on, like buttons. I dont know how this bar is called and how to create one for every CView.

I have a picture of it here to explain what i want. http://www.4shared.com/dir/32975742/b4bac91c/CView_Bar.html

Could someone please tell me what kind of bar this would be and how to create it for CViews?

Thanks.

+1  A: 

I think, what you want is basically a Toolbar (to answer your question how it is called) in an MDIChildWindow (similar like the toolbar in the main frame window of your application which is created usually by the MFC application wizard automatically). The way to add a toolbar in a child frame window is very analogous to what the wizard has added to the main frame window. You can decide in code where the toolbar shall be located (top, bottom, left, ...)

You can find a brief "How to..." here: http://support.microsoft.com/kb/155141

Also try to google by "Toolbar in MDIChildWindow" or similar. You'll find many resources, I believe.

Slauma
Yes this is what i wanted, i used the link from microsoft to create it. But if i run my app. it displays a messagebox saying: failed to create empty document. What goes wrong here ? I also found an example on: http://www.dotnetheaven.com/Uploadfile/mahesh/docktoolbar05182005050342AM/docktoolbar.aspx which does create the toolbar. I also copied and pasted this code example in my prjoject and this also results in the message: failed to create empty document. Any help would be appreciated!
Nijenhuis
failed to create empty document means failed to create doc/view/frame. check if any of your function returning an abort value.
Sheng Jiang 蒋晟
@Nijenhuis: Did you get this message really after you added the code from the MS page? That would be strange because it has nothing to do with document creation. As Sheng Jiang recommended check the return values of the startup functions of your app, or place some breakpoints in InitInstance, OnCreate etc. and debug through the app to find out where this message pops up. It's hard to tell you more without seeing your source code.
Slauma
I solved the: failed to create empty document.I did not have an ID for the toolbar button, but i now have posted a new question for a new problem, maybe you could say something about that too.
Nijenhuis