I'd look at simply adding another user window within the pane. It might need
a little work to hook up any buttons but it sounds like an easier approach
to me than inserting a CFrameWnd. I just don't see that approach working
myself.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Kamil Grabowski" <Kamil Grab...@discussions.microsoft.com> wrote in
message news:AAC40FF0-14C3-48CB...@microsoft.com...
So what you are suggesting is to derive a class from CWnd, add support for
toolbars/dialog bars and embed a CView-derived class in it? Did I get it
straight?
I use frame windows all the time as splitter window panes.
It seems you have a problem somewhere else - perhaps destroying a CFrameWnd
twice? Remember CFrameWnds delete themselves when they are destroyed - not
the same behavior as other windows/views.
How are you setting the frame window as a splitter pane?
I use CSplitterWnd::CreateView() and have n problems.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"Kamil Grabowski" <Kamil Grab...@discussions.microsoft.com> wrote in
message news:AAC40FF0-14C3-48CB...@microsoft.com...
Thats not true. CControlBar derived classes assume CFrameWnd as the parent.
You can make it work, but you will need to do some extra work as shown in
DLGCBR32 example where a Dialog hosts a toolbar and a status bar.
> I use frame windows all the time as splitter window panes.
That is possible. CFrameWnd can be a child window as well.
---
Ajay
Indeed! I have a LOT of them in my apps :)
Cheers,
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
>
> ---
> Ajay
>
I create a new MFC application project - SDI app with Windows Explorer style
and no additional features except the control manifest. Next, I use Class
Wizard to derive a class from CFrameWnd (I call it CMyFrame, but that's
irrelevant). Then I change the default code for creating splitter window
panes with:
BOOL bRightOk, bLeftOk;
bRightOk = m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CMyFrame),
CSize(100, 100), pContext);
pContext->m_pNewViewClass = RUNTIME_CLASS(CMfcApp3View);
bLeftOk = m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CMyFrame),
CSize(100, 100), pContext);
I think the problem is that the view attached to the left pane frame window
(CLeftView as created by the Wizard) is also attached via the document
template to the CMainFrame (also created by the wizard). Any suggestions
here? As I said, it fails on the OnClose() method.
I can't pinpoint the exact problem you are having, but here's what I do:
I DON'T use the context in the CreateView() calls - I pass NULL instead.
In the frame window classes, I override PreCreateWindow() as follows:
BOOL CMyFramePaneWnd::PreCreateWindow(CREATESTRUCT& cs)
{
CFrameWnd::PreCreateWindow(cs);
cs.style = (WS_CHILD | WS_VISIBLE);
cs.dwExStyle = 0;
return TRUE;
}
That's all the special code I use.
If you have frame windows with views being created through the doc/view
docmanager stuff, then that's a different thing that needs to be dealt with.
When using a frame as a splitter pane, the creation is different - the frame
window is created without a document initially.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
>