Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
C++
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();
Posted
Updated 25-Dec-11 20:29pm
v4

1 solution

Did u make the splitter windows as child???
 
Share this answer
 
Comments
anushagodavarthi 3-Jan-12 1:31am    
Yes
anushagodavarthi 3-Jan-12 1:33am    
m_dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER
renj00790 9-Jan-12 0:24am    
no..i mean go to the dialogue you have created..then right click it..go to properties...choose style->child..after run it..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900