Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - A problem : Adding CSplitterWnd to CView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

A problem : Adding CSplitterWnd to CView

 Post Reply Post Reply
Author
Message
qinzhw View Drop Down
Newbie
Newbie


Joined: 25 November 2005
Location: Colombia
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote qinzhw Quote  Post ReplyReply Direct Link To This Post Topic: A problem : Adding CSplitterWnd to CView
    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???

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 28 November 2005 at 1:42pm

CSplitterWnd can be child of CFrameWnd classes only.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.