titanandrews
Programmer
Hi,
I am attempting to create a tree control inside a splitter window, but I'm having a bit of difficulty. My code looks like this:
I create the splitter window in the overriden OnCreateClient() function just like MFC doc says, but when I run in debug mode, I get an assertion failure in winsplit.cpp It tells me this: "Error: CreateView - pane already exists for row 0, 0"
Could someone kindly give me some guidance about what I am doing wrong? MFC doc is a little unclear (or maybe it's just me) and I can't seem to find any samples.
many thanks,
Barry
I am attempting to create a tree control inside a splitter window, but I'm having a bit of difficulty. My code looks like this:
Code:
#include "stdafx.h"
#include "SplitterTest.h"
#include "ChildFrm.h"
#include "ATree.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,CCreateContext* pContext)
{
ATree atree;
BOOL bCreate = m_wndSplitter.Create(this,1,2,CSize(50,50),pContext);
m_wndSplitter.CreateView(0,0,atree.GetRuntimeClass(),CSize(100,100),pContext);
return bCreate;
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
Could someone kindly give me some guidance about what I am doing wrong? MFC doc is a little unclear (or maybe it's just me) and I can't seem to find any samples.
many thanks,
Barry