I am trying to put a view class into each splitter window.

I have a problem with using m_leftClass. I want to use m_leftClass so I can attach it to a separate ViewClass and RichEditCtrl class. The problem is I get "Failed to create empty document" message box error.

If I use pContext->m_pNewViewClass instead of m_leftClass., I don't get the error, but I don't know how to use pContext->m_pNewViewClass object with RichEditCtrl.



Here is my code:

Code:
m_leftClass  = RUNTIME_CLASS(CView);
	m_rightClass = RUNTIME_CLASS(CRConsole);

	// create a splitter with 1 row, 2 columns
	if (!m_wndSplitter.CreateStatic
		(this, 1, 2, WS_CHILD | WS_VISIBLE, AFX_IDW_PANE_FIRST))
		//(this, 1, 2))
	{
		TRACE0("Failed to CreateStaticSplitter\n");
		return FALSE;
	}

	//for sizing of split windows
	CRect rc;
	GetClientRect(&rc);

	//pContext->m_pNewViewClass

	// add the first splitter pane - the default view in column 0
	if (!m_wndSplitter.CreateView(0, 0,
		m_leftClass, CSize(rc.Width()/2,rc.Height()), pContext))//m_left class not being used
	{
		TRACE0("Failed to create first pane\n");
		return FALSE;
	}

	// add the second splitter pane - an input view in column 1
	if (!m_wndSplitter.CreateView(0, 1,
		m_rightClass, CSize(0, 0), pContext))
	{
		TRACE0("Failed to create first pane\n");
		return FALSE;
	}