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?
C
Christopher
@Christopher
Posts
-
CFormView Throwing Exception -
Where to put header filesI have just started to make my first MFC programs, and I am having a big problem. Whenever I alter the code and need to insert a heared file I recieve all kinds of errors. For example I am writing a program that contains a splitter window, with forms on both sides. In it I call splinterwnd.CreatView with a reference to the form class. But when I put the form header at the top I get errors (mainly c:\program files\microsoft visual studio\myprojects\temp\tempview.h(27) : error C2143: syntax error : missing ';' before '*') How do I know where to put the header file?