When the splitter window is destroyed and created again the views (same
RUNTIME_CLASS
) are not visible that are attached to splitter wnd in mfc vc++ why.
I am Doing like this.
if (m_pwndSplitter)
{ m_pwndSplitter->DestroyWindow (); delete m_pwndSplitter; m_pwndSplitter = NULL; }
if (m_pwndSplitter2)
{ m_pwndSplitter2->DestroyWindow (); delete m_pwndSplitter2; m_pwndSplitter2 = NULL; }
if (m_pwndSplitter3)
{ m_pwndSplitter3->DestroyWindow (); delete m_pwndSplitter3; m_pwndSplitter3 = NULL; }
m_pwndSplitter = new CSplitterWnd;
m_pwndSplitter->CreateStatic(this, 4, 1,m_dwStyle, this->IdFromRowCol (2,0));
VERIFY (m_pwndSplitter->CreateView (0, 0, view1,_FifthViewSize, m_pContext));
VERIFY (m_pwndSplitter->CreateView (1, 0, view2, m_FifthViewSize,m_pContext));
VERIFY (m_pwndSplitter->CreateView (3, 0, view3, m_SixthViewSize,m_pContext));
m_pwndSplitter3 = new CSplitterWnd;
m_pwndSplitter3->CreateStatic(m_pwndSplitter, 1, 2, m_dwStyle, m_pwndSplitter->IdFromRowCol(2,0));
VERIFY (m_pwndSplitter3->CreateView (0, 0, pSpecView, m_ThirdViewSize,m_pContext));
VERIFY (m_pwndSplitter3->CreateView (0, 1, pDrView, m_ThirdViewSize,m_pContext));
SetRowInfo (0, 50, 50);
SetRowInfo (1, 50, 50);
RecalcLayout ();
m_pwndSplitter->SetColumnInfo (0, 500, 0);
m_pwndSplitter->SetRowInfo (0, 130, 0);
m_pwndSplitter->SetRowInfo (1, 130, 0);
m_pwndSplitter->SetRowInfo (2, 130, 0);
m_pwndSplitter->SetRowInfo (3, 100, 0);
m_pwndSplitter->RecalcLayout ();
m_pwndSplitter3->SetColumnInfo (0, 500, 0);
m_pwndSplitter3->RecalcLayout ();
bViewSts = TRUE;
RecalcLayout();