views:

2281

answers:

5

Hello all,

How can I place a MFC CFormView inside a CDockablePane which was introduced in the VS 2008 MFC Feature Pack?

Thanks.

+1  A: 

Check the BCGSoft Samples for doing this with a cview. The class names are a little different but its more or less the same stuff since they provided CDockablePane to Microsoft.

Aaron Fischer
I only see binaries there, no source for the samples.
mxp
A: 

There is a sample of the feature pack that does this.

However, what I do is the following: I made a CDialog-derived class that I put in the DockablePane. Then I make a CFormView-derived class and make an instance of that a member variable of the dockable pane. Every function that I'm interested in (most likely UpdateView() or whatever it's called), I forward to the CDialog-derived class. That way I can sidestep the difficulties of shoehorning the doc/view structure into my application and still get the benefits.

Roel
A: 

Actually there are a few ways of doing this.

If you derive your own CFameWnd class and then put an instance of that class in the CDockable pane you now can put whatever type of framework that you want inside of that CFrameWnd derived class.

The trick is to make sure that you are doing the creation in the correct order. If you try to call it to early then your internal views will never be created.

A: 

Hello, Roel

I couldn't find such samples in MFC Feature Pack samples.

All projects containing CFormView are :

TasksPane TabControl TabbedView StatusBarDemo SetPaneSize MenuSubSet

But in any of the projects, CFormView is not embedded in CDockablePane.

JongAm Park
A: 

Probably this cab be a clue.

http://www.codeproject.com/KB/toolbars/sizecbar.aspx

Although it doesn't use CDockablePane, concept behind it is same. I didn't try CDockablePane and CFormView work like the one explained in the page yet, but by taking a glance at it, I feel that things are similar.

JongAm Park
I put a blog post to my blog. I didn't handle window message issues yet, but it could be a good start for anyone who are interested in this issue. http://developer.apple.com/mac/library/documentation/Networking/Conceptual/CFNetwork/Concepts/Concepts.html#//apple_ref/doc/uid/TP30001132-CH4-SW10
JongAm Park