CSplitterWnd with MDI Child Windows
-
I create mdi application with splitter in MainFrame with two areas. In first area i suppose to a static control and MDI child windows in second. The CSplitterWnd is created, but i can`t create MDI child window in splitter panel. I have the following code in OnCreateClient function
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_mainSplitter.CreateStatic(this, 1, 2, WS_VISIBLE | WS_CHILD, AFX_IDW_PANE_FIRST))
{
//MessageBox( "Error setting up m_mainSplitter", "ERROR", MB_OK | MB_ICONERROR );
return FALSE;
}
if (!m_mainSplitter.CreateView(0, 0, RUNTIME_CLASS(CMDIAppView),
CSize(140, cr.Height()), pContext))
{
//MessageBox( "Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR );
return FALSE;
}if (!m\_mainSplitter.CreateView(0, 1, RUNTIME\_CLASS(CMDIAppView), CSize(cr.Width()-140, cr.Height()), pContext)) { //MessageBox( "Error setting up splitter view", "ERROR", MB\_OK | MB\_ICONERROR ); return FALSE; } m\_bInitSplitter = true; return CreateClient(lpcs, NULL);
}
I try to change CChildFrame::OnCreate
with CWnd* pView = GetDlgItem(AFX_IDW_PANE_FIRST);
cs.hwndParent = pView->m_hWnd;
but i have a error. I think that CMDIAppView is corresponded to CMDiChild view area in MDI application and conflicted with created splitter, i tryed to create splitterview in another class but still unsuccessful.
I found article "SDI Application with MDI Child Windows in Static Splitter Pane" by John Z. Czopowik in codeguru but can not download source code from there. Please can anyone explane me how to create mdi child windows in splitter panel.
Mikle G.
email: mg17110081@gmail.com -
I create mdi application with splitter in MainFrame with two areas. In first area i suppose to a static control and MDI child windows in second. The CSplitterWnd is created, but i can`t create MDI child window in splitter panel. I have the following code in OnCreateClient function
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (!m_mainSplitter.CreateStatic(this, 1, 2, WS_VISIBLE | WS_CHILD, AFX_IDW_PANE_FIRST))
{
//MessageBox( "Error setting up m_mainSplitter", "ERROR", MB_OK | MB_ICONERROR );
return FALSE;
}
if (!m_mainSplitter.CreateView(0, 0, RUNTIME_CLASS(CMDIAppView),
CSize(140, cr.Height()), pContext))
{
//MessageBox( "Error setting up splitter view", "ERROR", MB_OK | MB_ICONERROR );
return FALSE;
}if (!m\_mainSplitter.CreateView(0, 1, RUNTIME\_CLASS(CMDIAppView), CSize(cr.Width()-140, cr.Height()), pContext)) { //MessageBox( "Error setting up splitter view", "ERROR", MB\_OK | MB\_ICONERROR ); return FALSE; } m\_bInitSplitter = true; return CreateClient(lpcs, NULL);
}
I try to change CChildFrame::OnCreate
with CWnd* pView = GetDlgItem(AFX_IDW_PANE_FIRST);
cs.hwndParent = pView->m_hWnd;
but i have a error. I think that CMDIAppView is corresponded to CMDiChild view area in MDI application and conflicted with created splitter, i tryed to create splitterview in another class but still unsuccessful.
I found article "SDI Application with MDI Child Windows in Static Splitter Pane" by John Z. Czopowik in codeguru but can not download source code from there. Please can anyone explane me how to create mdi child windows in splitter panel.
Mikle G.
email: mg17110081@gmail.comMember 13277911 wrote:
...but i have a error.
What error?
Member 13277911 wrote:
...but can not download source code from there.
Why not? Can you get it from here instead?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Member 13277911 wrote:
...but i have a error.
What error?
Member 13277911 wrote:
...but can not download source code from there.
Why not? Can you get it from here instead?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
in codeguru SDI Application with MDI Child Windows in Static Splitter Pane i don't have permission to access on this server. The error is First-chance exception at 0x00D91166 in MDIAppView.exe: 0xC0000005: Access violation reading location 0x00000020. if i add cs.hwndParent = pView->m_hWnd; to CChildFrame::PreCreateWindow this error while MFC window creation i think. may be subclass the child window can resolve this problem but i dont know how to subclass MDIChild with panel. i know that WTL can place mdichild window in CSplitterWnd The suppose is to create MFC mdichild window with CSplitterWnd as parent in MFC program.
-
Member 13277911 wrote:
...but i have a error.
What error?
Member 13277911 wrote:
...but can not download source code from there.
Why not? Can you get it from here instead?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
Thanks for program. I think it helps in solution.