CFormView Throwing Exception
-
I am writing a program that has two windows in it (splitter). I want both sides to run a dialog. I have created the one for the right side, but when I try and run it I get a debug assertion error. Here is the code I am using: In CMainFrame: BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { if (!m_wndSplitter.CreateStatic(this, 1, 2, WS_CHILD) ) { AfxMessageBox("Error Creating Splitter Window. [CSplitter::CreatStatic]", MB_OK); AfxAbort(); //Failed To Create Splitter Window } SIZE wndSize; wndSize.cx=300; wndSize.cy=600; if ( (!m_wndSplitter.CreateView(0,0, RUNTIME_CLASS(CTestView), wndSize, pContext)) || (!m_wndSplitter.CreateView(0,1, RUNTIME_CLASS(CTagDlg), wndSize, pContext)) ) { AfxMessageBox("Error Creating Splitter Views. [CSplitter::CreateView]", MB_OK); AfxAbort(); //Check both views } return TRUE; } The error seems to come from viewform.cpp, in CFormView::Create it call this function: if (!_AfxCheckDialogTemplate(m_lpszTemplateName, TRUE)) { ASSERT(FALSE); // invalid dialog template name PostNcDestroy(); // cleanup if Create fails too soon return FALSE; } And that is what is throwing the exception. Anyone know how I can fix this?