Home > Software engineering >  VC: split window, switch view display problems
VC: split window, switch view display problems

Time:01-24

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 farther function BOOL CChildFrame: : OnCreateClient (LPCREATESTRUCT LPCS, CCreateContext * pContext) function in the 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,

CodePudding user response:

There are two at the same time, should be can't use, can directly make the split window 2 * 2?
  • Related