Environment: VS2019, vc program established for more than a document, in ChildFrm. H file add variables:
CSplitterWndEx * m_pMainSplitter;
CSplitterWndEx * m_pFeilvSpli;
In ChildFrm. CPP file, BOOL CChildFrame: : OnCreateClient (LPCREATESTRUCT LPCS, CCreateContext * pContext) function in the add code:
M_pMainSplitter=new CSplitterWndEx ();
VERIFY (m_pMainSplitter - & gt; CreateStatic (this, 1, 2));
VERIFY (m_pMainSplitter - & gt; CreateView (0, 0, RUNTIME_CLASS (CCeshiView), sizeLeft, pContext));
VERIFY (m_pMainSplitter - & gt; CreateView (0, 1, RUNTIME_CLASS (CCeshiView), sizeRight, pContext));
RecalcLayout ();
The above procedure can run correctly,
If in the function BOOL CChildFrame: : OnCreateClient (LPCREATESTRUCT LPCS, CCreateContext * pContext) function add code:
M_pFeilvSpli=new CSplitterWndEx ();
VERIFY (m_pFeilvSpli - & gt; CreateStatic (this, 1, 2));
VERIFY (m_pFeilvSpli - & gt; CreateView (0, 0, RUNTIME_CLASS (CCeshiView), sizeLeft2, pContext));
VERIFY (m_pFeilvSpli - & gt; CreateView (0, 1, RUNTIME_CLASS (CCeshiView), sizeRight2, pContext));
M_pFeilvSpli - & gt; ShowWindow (0);
Split window can not be displayed correctly,
Excuse me each great god, where problems? I want to rely on the above code was meant to ShowWindow (0) and ShowWindow (1), to hide and display of the split view, the purpose of realizing to switch back and forth,