End Google Ads 201810 - BS.net 01 --> I have a single document frame window with multiple views and I'm trying to add a view that contains a splitter ********

For this new view I have created a base CView that contains a CSplitterWnd. The splitter has one row, and two columns. The left column is a CTreeView derivative, and the right column is a CView derivative that contains a CMFCPropertyGridCtrl.

When the program switches to this new view, it is totally blank with no splitter bar or child views. What have I failed to do to get the splitter view to display correctly? Is it valid for a CSplitterWnd to be hosted inside a CView?

This is the code inside the base CView that creates the splitter:
int CGSFeaturesView::OnCreate(LPCREATESTRUCT lpCreateStruct){ if (CView::OnCreate(lpCreateStruct) == -1) return -1; Splitter.CreateStatic(this, 1, 2); CCreateContext Context; Context.m_pCurrentDoc = GetDocument(); Splitter.CreateView(0, 0, RUNTIME_CLASS(CGSFeatureTreeView), CSize(0,0), &Context); Splitter.CreateView(0, 1, RUNTIME_CLASS(CGSFeaturePropertyView), CSize(0,0), &Context); Splitter.SetColumnInfo(0, 300, 200); Splitter.SetColumnInfo(1, 300, 200); Splitter.SetRowInfo(0, 1000, 200); return 0;}
This is the code inside the CWinApp that switches views: (Taken from the MSDN example that shows how to create multiple views for a single document)
void CGSApp::SwitchToView(CView* pNewView){ CView* pActiveView = ((CFrameWnd*) m_pMainWnd)->GetActiveView(); // Exchange view window IDs so RecalcLayout() works. UINT temp = ::GetWindowLong(pActiveView->m_hWnd, GWL_ID); UINT temp1 = ::GetWindowLong(pNewView->m_hWnd, GWL_ID); ::SetWindowLong(pActiveView->m_hWnd, GWL_ID, temp1); ::SetWindowLong(pNewView->m_hWnd, GWL_ID, temp); pActiveView->ShowWindow(SW_HIDE); pNewView->ShowWindow(SW_SHOW); ((CFrameWnd*) m_pMainWnd)->SetActiveView(pNewView); ((CFrameWnd*) m_pMainWnd)->RecalcLayout(); pNewView->Invalidate();}Thank you for reading my question.



The difficult we do right away...
...the impossible takes slightly longer.