Click here to Skip to main content
16,015,274 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Height of Text Pin
cmk13-Sep-04 13:00
cmk13-Sep-04 13:00 
GeneralCopy Constructor Pin
Prudhvi Raju13-Sep-04 10:10
Prudhvi Raju13-Sep-04 10:10 
GeneralRe: Copy Constructor Pin
act_x13-Sep-04 10:25
act_x13-Sep-04 10:25 
GeneralRe: Copy Constructor Pin
BlackDice13-Sep-04 11:58
BlackDice13-Sep-04 11:58 
GeneralRe: Copy Constructor Pin
Anonymous13-Sep-04 12:14
Anonymous13-Sep-04 12:14 
QuestionHow to idintify a DLL whether it is a normal dll or it is a COM DLL Pin
Prudhvi Raju13-Sep-04 9:57
Prudhvi Raju13-Sep-04 9:57 
AnswerRe: How to idintify a DLL whether it is a normal dll or it is a COM DLL Pin
Anonymous13-Sep-04 15:14
Anonymous13-Sep-04 15:14 
GeneralDoc View architecture Pin
act_x13-Sep-04 9:41
act_x13-Sep-04 9:41 
I m working on an MFC based MDI application . My view is of type CFormView and I currently have a CTreeCtrl as a component on the Form .


What I want to know is that when the app is executed a default document is opened , but is not sized proportional to the size of the mainframe . Same is the case for all new Documents opened . What is the right way of resizing the view ? Does the view do it based on the parent CFrameWnd or does the mainFrame handle this ?

Right now Im doing this in the View class to resize the view based on the MainWindow
void CMyView::OnSize(UINT nType, int cx, int cy) <br />
{<br />
	if(init){	<br />
	CRect r;<br />
	this->GetParentFrame()->GetParent()->GetClientRect(&r);<br />
	this->GetParentFrame()->MoveWindow(r);<br />
	this->GetParentFrame()->GetClientRect(&r);<br />
	m_tree.SetWindowPos(0,r.left+5,r.top+5,r.Width()/3-10,r.Height()-10,0);<br />
	return ;<br />
	}	<br />
	CFormView::OnSize(nType, cx, cy);<br />
} 


void CMyView::OnInitialUpdate()<br />
{<br />
	CFormView::OnInitialUpdate();<br />
<br />
	init = true ; <br />
	<br />
	<br />
<br />
	ResizeParentToFit();<br />
	<br />
<br />
}


and this in the MainFrame :
void CMainFrame::OnSize(UINT nType, int cx, int cy) <br />
{<br />
	CMDIFrameWnd::OnSize(nType, cx, cy);<br />
	<br />
	CRect r;<br />
	this->GetClientRect(&r);<br />
	CFrameWnd *wnd;<br />
        wnd =this->GetActiveFrame();<br />
	if(wnd){<br />
		wnd->MoveWindow(r);<br />
	}<br />
	<br />
}

so that the view is resized when the mainFrame is moved .

I get a feeling there might be a better way to do this .
GeneralRe: Doc View architecture Pin
Joel Holdsworth13-Sep-04 10:48
Joel Holdsworth13-Sep-04 10:48 
GeneralRe: Doc View architecture Pin
BlackDice13-Sep-04 12:02
BlackDice13-Sep-04 12:02 
GeneralC/C++ Scripters Wanted For New Games Company Pin
KingsZone13-Sep-04 8:32
sussKingsZone13-Sep-04 8:32 
GeneralRe: C/C++ Scripters Wanted For New Games Company Pin
Michael Dunn13-Sep-04 8:54
sitebuilderMichael Dunn13-Sep-04 8:54 
GeneralVC IDE Pin
Scott L. Robik13-Sep-04 8:10
Scott L. Robik13-Sep-04 8:10 
GeneralA push in the right direction please. Pin
mcgahanfl13-Sep-04 7:08
mcgahanfl13-Sep-04 7:08 
GeneralRe: A push in the right direction please. Pin
David Crow13-Sep-04 7:44
David Crow13-Sep-04 7:44 
GeneralRe: A push in the right direction please. Pin
mcgahanfl13-Sep-04 7:58
mcgahanfl13-Sep-04 7:58 
GeneralRe: A push in the right direction please. Pin
David Crow13-Sep-04 8:13
David Crow13-Sep-04 8:13 
GeneralRe: A push in the right direction please. Pin
mcgahanfl13-Sep-04 8:28
mcgahanfl13-Sep-04 8:28 
GeneralReturn value Pin
Timothy198213-Sep-04 6:39
Timothy198213-Sep-04 6:39 
GeneralRe: Return value Pin
David Crow13-Sep-04 7:46
David Crow13-Sep-04 7:46 
GeneralRe: Return value Pin
Timothy198214-Sep-04 0:15
Timothy198214-Sep-04 0:15 
GeneralRe: Return value Pin
BlackDice13-Sep-04 12:04
BlackDice13-Sep-04 12:04 
GeneralFullscreen weirdness in XP Pin
Jörgen Sigvardsson13-Sep-04 5:34
Jörgen Sigvardsson13-Sep-04 5:34 
GeneralRe: Fullscreen weirdness in XP Pin
mcgahanfl13-Sep-04 7:09
mcgahanfl13-Sep-04 7:09 
GeneralShow 2 dialog windows Pin
Larsson13-Sep-04 5:07
Larsson13-Sep-04 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.