Board index » Visual Studio » CSplitterWnd, CFormView and a debug assertion failure

CSplitterWnd, CFormView and a debug assertion failure

Visual Studio151
Hello group-



I'm using the following code to set up two views using CSplitterWnd, on the

left side is a normal CView object and on the right side a CFormView object

with a tab control in it.



if(!m_wndSplitter.CreateStatic(this, 1, 2)) return FALSE;



// CNormalView descends from CView



if(!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CNormalView), CSize(100,

100), pContext) return FALSE;



// CTabbedView descends from CFormView



if(!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CTabbedView), CSize(100,

100), pContext)) return FALSE; <<--- DEBUG ASSERTION FAILURE







What causes this error? What I'm trying to do is simply put a tabbed control

on the right side of the window, if this isn't the right approach I'd like

to know it.


-
 

Re:CSplitterWnd, CFormView and a debug assertion failure

loquak wrote:

Quote
Hello group-



I'm using the following code to set up two views using CSplitterWnd, on the

left side is a normal CView object and on the right side a CFormView object

with a tab control in it.



if(!m_wndSplitter.CreateStatic(this, 1, 2)) return FALSE;



// CNormalView descends from CView



if(!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CNormalView), CSize(100,

100), pContext) return FALSE;



// CTabbedView descends from CFormView



if(!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CTabbedView), CSize(100,

100), pContext)) return FALSE; <<--- DEBUG ASSERTION FAILURE







What causes this error? What I'm trying to do is simply put a tabbed control

on the right side of the window, if this isn't the right approach I'd like

to know it.



You have not provided any information that could help diagnose the

problem. You need to look at the ASSERT statement that failed, and the

value of whatever variables were involved at that point, and the class

and function that contain the ASSERT. You can only do this if you

install the MFC source code from the CD.



--

Scott McPhillips [VC++ MVP]



-

Re:CSplitterWnd, CFormView and a debug assertion failure



"Scott McPhillips [MVP]" <scottmcp@mvps.org.nothere>wrote in message

[snip]

Quote


You have not provided any information that could help diagnose the

problem. You need to look at the ASSERT statement that failed, and the

value of whatever variables were involved at that point, and the class

and function that contain the ASSERT. You can only do this if you

install the MFC source code from the CD.



Thanks for the feedback, there was indeed an explanation for the error which

I had overlooked - the resource should have been set to child style!





-