Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNTFS Driver information Pin
abhinarulkar15-Sep-03 3:02
abhinarulkar15-Sep-03 3:02 
GeneralRe: NTFS Driver information Pin
Alexander M.,16-Sep-03 5:18
Alexander M.,16-Sep-03 5:18 
GeneralException about "Float Invalid Opration" Pin
yzpower15-Sep-03 2:33
sussyzpower15-Sep-03 2:33 
GeneralRe: Exception about "Float Invalid Opration" Pin
Jagadeesh VN15-Sep-03 3:13
Jagadeesh VN15-Sep-03 3:13 
GeneralPlease help me! Thanks! Pin
HansonDavid15-Sep-03 2:24
HansonDavid15-Sep-03 2:24 
GeneralMultiples views in Doc/View Pin
Cedric Moonen15-Sep-03 2:03
Cedric Moonen15-Sep-03 2:03 
GeneralRe: Multiples views in Doc/View Pin
JWood15-Sep-03 3:40
JWood15-Sep-03 3:40 
GeneralRe: Multiples views in Doc/View Pin
Cedric Moonen15-Sep-03 4:06
Cedric Moonen15-Sep-03 4:06 
I found a much easier solution:

I have 2 member variables of CMainFrame (the 2 views):
CView*  m_pScopeView;
CView*  m_pXYView;


In CMainFrame::CreateClient, I do this:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
{
	// TODO: Add your specialized code here and/or call the base class
	CRect ClientRect;
	GetClientRect(ClientRect);

	m_pScopeView = (CView*)new CExtScopeView;
	m_pScopeView->Create(NULL, NULL, WS_CHILD, CFrameWnd::rectDefault, this, SCOPE_VIEW, pContext);
	m_pScopeView->OnInitialUpdate();

	m_pXYView = (CView*)new CXYView;
	m_pXYView->Create(NULL, NULL, WS_CHILD, ClientRect, this, XY_VIEW, pContext);
	m_pXYView->OnInitialUpdate();

	SetActiveView(m_pScopeView);
	m_pScopeView->ShowWindow(SW_SHOW);

	m_pXYView->SetDlgCtrlID(XY_VIEW);
	m_pScopeView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
	RecalcLayout();

	return TRUE;
}


And when I select another view:
void CMainFrame::OnXYView() 
{

	// TODO: Add your command handler code here
	SetActiveView(m_pXYView);
	m_pXYView->ShowWindow(SW_SHOW);
	m_pXYView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);

	m_pScopeView->ShowWindow(SW_HIDE);
	m_pScopeView->SetDlgCtrlID(fActiveView);
	RecalcLayout();

	fActiveView = XY_VIEW;
}


This work fine exept that the toolbar is drawn 1 or 2 pixels under the normal position and so, there's no separating line between the toolbar and the form view. This is very ugly!

How can I avoid this ???
Thanks
GeneralRe: Multiples views in Doc/View Pin
JWood15-Sep-03 4:15
JWood15-Sep-03 4:15 
GeneralRe: Multiples views in Doc/View Pin
Cedric Moonen15-Sep-03 4:34
Cedric Moonen15-Sep-03 4:34 
GeneralRe: Multiples views in Doc/View Pin
JWood15-Sep-03 4:51
JWood15-Sep-03 4:51 
GeneralRe: Multiples views in Doc/View Pin
Cedric Moonen15-Sep-03 5:15
Cedric Moonen15-Sep-03 5:15 
GeneralRe: Multiples views in Doc/View Pin
JWood15-Sep-03 5:54
JWood15-Sep-03 5:54 
GeneralRe: Multiples views in Doc/View Pin
Cedric Moonen15-Sep-03 21:46
Cedric Moonen15-Sep-03 21:46 
Questionopen IE??? Pin
xxhimanshu15-Sep-03 1:59
xxhimanshu15-Sep-03 1:59 
AnswerRe: open IE??? Pin
Jagadeesh VN15-Sep-03 3:14
Jagadeesh VN15-Sep-03 3:14 
AnswerRe: open IE??? Pin
David Crow15-Sep-03 3:57
David Crow15-Sep-03 3:57 
GeneralRe: open IE??? Pin
xxhimanshu15-Sep-03 18:50
xxhimanshu15-Sep-03 18:50 
GeneralRe: open IE??? Pin
David Crow16-Sep-03 5:23
David Crow16-Sep-03 5:23 
GeneralRe: open IE??? Pin
xxhimanshu16-Sep-03 17:52
xxhimanshu16-Sep-03 17:52 
GeneralReceiving own written com port data Pin
od@ananzi.co.za15-Sep-03 1:24
od@ananzi.co.za15-Sep-03 1:24 
GeneralTypeCasting Pin
KKR15-Sep-03 1:09
KKR15-Sep-03 1:09 
GeneralRe: TypeCasting Pin
Roger Allen15-Sep-03 2:36
Roger Allen15-Sep-03 2:36 
GeneralRe: TypeCasting Pin
Jagadeesh VN15-Sep-03 3:23
Jagadeesh VN15-Sep-03 3:23 
QuestionOne Socket for listening and sending/receiving, simultaneously? Pin
Aidman15-Sep-03 0:45
Aidman15-Sep-03 0:45 

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.