|
-
March 31st, 1999, 09:58 PM
#1
How can i maximized first default view, at MDI Mode.
Hi, everyone.
I appreciated your interest.
Now, the problem is just like this;
I created a project, in MDI mode with View inherited from CRecordView.
I implented those codes to maximize a first default view which is displayed
at running the project. I overrided OnActivateView like this:
void CTraceView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
// TODO: Add your specialized code here and/or call the base class
CRecordView::OnActivateView(bActivate, pActivateView, pDeactiveView);
pFrame= (CMDIFrameWnd*) AfxGetApp()->m_pMainWnd;
pChild= (CMDIChildWnd*) pFrame->GetActiveFrame();
pChild->MDIMaximize();
}
The problem is that: while i am running this EXE file, there is no error. but
after i terminate this runned EXE program, a error message dialog happens.
What's may be the bug. When I deleted (pChild->MDIMaxmize() ) , there was no
that problem.
please help me.... 
-
March 31st, 1999, 10:54 PM
#2
Re: How can i maximized first default view, at MDI Mode.
You can change the child frame window's style to the following:
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style |= WS_CHILD | WS_VISIBLE | WS_OVERLAPPED | WS_CAPTION
| WS_SYSMENU | FWS_ADDTOTITLE | WS_THICKFRAME | WS_MINIMIZEBOX
| WS_MAXIMIZEBOX | WS_MAXIMIZE;
return CMDIChildWnd::PreCreateWindow(cs);
}
All child frame windows will have maximized view. If you just want the first view to be maximized, just use a flag in the function.
Hope this will help. Good luck.
Allen
-
April 1st, 1999, 12:02 AM
#3
Re: How can i maximized first default view, at MDI Mode.
Thanks, Allen.
It worked, but differs a little from what i wanted.
I'd like to expand a window just like as i clicks a maximizing button in a view.
cs|WS_MAXMIZE results like this;
----------------------------------------------
| [trace 1] (->this is main Frame menu. )
| File Edit
--------------------------------------------
******************************************
* Trace1 (->this is chiled apps doc name.
******************************************
*
*/// this area is child's.
*
*
*********************************************
-----------------------------------------------
But i want it like this. (fully maximized and no child windows outline.)
----------------------------------------------
| [trace 1] (->this is main Frame menu. )
| File Edit
--------------------------------------------
This is Child's -> Note difference from above.
No child window's outline.
-----------------------------------------------
Geese...... 
-
April 1st, 1999, 01:49 AM
#4
Re: How can i maximized first default view, at MDI Mode.
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
void CChildFrame::ActivateFrame(int nCmdShow)
{
//old:/*!CMDIChildWnd::ActivateFrame(nCmdShow);*/
CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED);//new
}
//http://members.xoom.com/jauming/
//[email protected]
-
April 1st, 1999, 01:49 AM
#5
Re: How can i maximized first default view, at MDI Mode.
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
void CChildFrame::ActivateFrame(int nCmdShow)
{
//old:/*!CMDIChildWnd::ActivateFrame(nCmdShow);*/
CMDIChildWnd::ActivateFrame(SW_SHOWMAXIMIZED);//new
}
//http://members.xoom.com/jauming/
//[email protected]
-
April 1st, 1999, 05:36 AM
#6
Re: How can i maximized first default view, at MDI Mode.
Yahoo!!!
It Worked COMPACTLY!
Thanks Kevin.... sincerely. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|