f***@leeds.ac.uk
2007-08-30 15:07:07 UTC
I have an MDI application where the application automatically displays
a dialogbox (derived from CFormView) on start up. I have created
another dialogbox (dialog2) and use the class wizard to derive this
from CFormView also (I want these boxes to have the properties
associated with child formviews i.e tile, cascade etc).
Please can somebody tell me a general method for displaying this
dialog2 (and later dialog3, etc) as a child within the confines of the
main frame?
The new child view (dialog2) should be displayed together with the old
one that is displayed on startup
The new view should be part of the original document (1 document only
for now)
At the moment I have:
void CMainFrame::OnViewDialog2()
{
CDialog2 * pView = NULL;
pView = new CDialog2();
pView ->Create(NULL, NULL, NULL, CFrameWnd::rectDefault, pView-
CMDIChildWnd* pFrame = (CMDIChildWnd*)GetParentFrame();
pFrame->SetActiveView(pView);
pFrame->RecalcLayout();
}
However this replaces my original dialog with the new dialog2 and I
want to see them both. Any help is very much appreciated.
a dialogbox (derived from CFormView) on start up. I have created
another dialogbox (dialog2) and use the class wizard to derive this
from CFormView also (I want these boxes to have the properties
associated with child formviews i.e tile, cascade etc).
Please can somebody tell me a general method for displaying this
dialog2 (and later dialog3, etc) as a child within the confines of the
main frame?
The new child view (dialog2) should be displayed together with the old
one that is displayed on startup
The new view should be part of the original document (1 document only
for now)
At the moment I have:
void CMainFrame::OnViewDialog2()
{
CDialog2 * pView = NULL;
pView = new CDialog2();
pView ->Create(NULL, NULL, NULL, CFrameWnd::rectDefault, pView-
GetParent(), NULL, NULL);
pView ->ShowWindow(SW_SHOW);CMDIChildWnd* pFrame = (CMDIChildWnd*)GetParentFrame();
pFrame->SetActiveView(pView);
pFrame->RecalcLayout();
}
However this replaces my original dialog with the new dialog2 and I
want to see them both. Any help is very much appreciated.