Print Page | Close Window

A problem : Adding CSplitterWnd to CView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3293
Printed Date: 20 June 2025 at 1:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: A problem : Adding CSplitterWnd to CView
Posted By: qinzhw
Subject: A problem : Adding CSplitterWnd to CView
Date Posted: 28 November 2005 at 7:05am

I have defined a class based on  CView like this :

class CSMSView : public CStaticFrameWnd<CView>
{
   ...
   protected:
     BOOL m_bInited ;
    CSplitterWndEx m_wndSplitter;
    CCreateContext* m_pCreateContext ;
   ....
 
 virtual void OnInitialUpdate();
}

and for some reason , I want to split it into 2 part with :

int CSMSView::OnCreate(LPCREATESTRUCT lpcs)
{

 if (CView::OnCreate(lpcs) == -1)
  return -1;
 
 m_bInited = FALSE ;
 if(lpcs) 
  m_pCreateContext = (CCreateContext*)lpcs->lpCreateParams ;
 else
  m_pCreateContext = NULL ;

 //*/
 return 0;
}

CSMSView::OnInitialUpdate(){

if(m_bInited) return ;
 m_bInited = TRUE ;

if (!m_wndSplitter.CreateStatic(this, 1, 2,  WS_CHILD | WS_VISIBLE ,   AFX_IDW_PANE_FIRST + 10))

 {
  TRACE0("Failed to create nested splitter\n");
  return ;
 }


 if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CWnd),
  CSize(175,100), m_pCreateContext))
 {
  TRACE0("Failed to create CContainerView\n");
  return ;
 }
 if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CWnd),
  CSize(175, 100), m_pCreateContext))
 {
  TRACE0("Failed to create CContainerView\n");
  return ;
 }

}

Definitions of CStaticFrameWnd and CSplitterWndEx are found in the GUI_Outlook sample .

 m_wndSplitter.CreateView and m_wndSplitter.CreateStatic return TRUE, but Windows in Splitter are absent, why???




Replies:
Posted By: Oleg
Date Posted: 28 November 2005 at 1:42pm

CSplitterWnd can be child of CFrameWnd classes only.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net