neilsolent
2011-12-13 08:50:11 UTC
In my VC++ 6 MDI application, I am creating a new window with the code
below.
This seems to work fine, but If I comment out the call to MDIMaximize,
the window does not initialize properly.
I don't really want a maximized window though - what did I do wrong
that means I need to call this function?
thanks,
Neil
CCreateContext context;
context.m_pCurrentDoc = NULL;
context.m_pCurrentFrame = NULL;
context.m_pLastView = NULL;
context.m_pNewDocTemplate = NULL;
context.m_pNewViewClass = NULL;
CDynamicChildFrame* queryWnd = new CDynamicChildFrame;
CSplitterWnd* querySplitter = new CSplitterWnd;
queryWnd->Create(NULL, "New query", WS_CHILD | WS_OVERLAPPEDWINDOW,
CFrameWnd::rectDefault, this);
querySplitter->CreateStatic(queryWnd, 1, 2, WS_CHILD | WS_VISIBLE,
AFX_IDW_PANE_FIRST);
querySplitter->CreateView(0, 0, RUNTIME_CLASS(CQueryFormView),
CSize(350, 100), &context);
querySplitter->CreateView(0, 1, RUNTIME_CLASS(CReportResultsView),
CSize(10, 10), &context);
CQueryFormView* queryFormView = (CQueryFormView*) querySplitter-
querySplitter->GetPane(0, 1);
doc->AddView(queryFormView);
doc->AddView(reportResultsView);
queryFormView->OnInitialUpdate();
reportResultsView->OnInitialUpdate();
MDIMaximize(queryWnd);
queryWnd->ModifyStyle(0, WS_VISIBLE);
querySplitter->SetActivePane(0, 0, NULL);
below.
This seems to work fine, but If I comment out the call to MDIMaximize,
the window does not initialize properly.
I don't really want a maximized window though - what did I do wrong
that means I need to call this function?
thanks,
Neil
CCreateContext context;
context.m_pCurrentDoc = NULL;
context.m_pCurrentFrame = NULL;
context.m_pLastView = NULL;
context.m_pNewDocTemplate = NULL;
context.m_pNewViewClass = NULL;
CDynamicChildFrame* queryWnd = new CDynamicChildFrame;
CSplitterWnd* querySplitter = new CSplitterWnd;
queryWnd->Create(NULL, "New query", WS_CHILD | WS_OVERLAPPEDWINDOW,
CFrameWnd::rectDefault, this);
querySplitter->CreateStatic(queryWnd, 1, 2, WS_CHILD | WS_VISIBLE,
AFX_IDW_PANE_FIRST);
querySplitter->CreateView(0, 0, RUNTIME_CLASS(CQueryFormView),
CSize(350, 100), &context);
querySplitter->CreateView(0, 1, RUNTIME_CLASS(CReportResultsView),
CSize(10, 10), &context);
CQueryFormView* queryFormView = (CQueryFormView*) querySplitter-
GetPane(0, 0);
CReportResultsView* reportResultsView = (CReportResultsView*)querySplitter->GetPane(0, 1);
doc->AddView(queryFormView);
doc->AddView(reportResultsView);
queryFormView->OnInitialUpdate();
reportResultsView->OnInitialUpdate();
MDIMaximize(queryWnd);
queryWnd->ModifyStyle(0, WS_VISIBLE);
querySplitter->SetActivePane(0, 0, NULL);