CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Splitter window

  1. #1
    Guest

    Splitter window

    Hi,
    I am trying to create a static splitter by declaring a protected variable of class CSplitterWnd in CMainFrame class and
    then overriding the OnCreateClient() function to create the window.
    I have tried many different ways to make the program run but each and every time it is giving me an assertion failure
    in file 'winsplit.cpp'.
    The code is:
    1) first , I tried....
    BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
    {
    m_wndSplitter.CreateStatic(this, 1,2);
    m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CSquareView),CSize(100,100), pContext));

    return TRUE;
    }

    2) Then I tried.........
    BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
    {
    VERIFY(m_wndSplitter.CreateStatic(this,1,2));
    VERIFY(m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CHydraqlView),CSize(100,100), pContext));

    return TRUE;
    }

    3) Then........
    BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
    {
    if (!m_wndSplitter.CreateStatic(this, 1, 2))
    {
    TRACE0("Failed to CreateStaticSplitter\n");
    return FALSE;
    }
    if (!m_wndSplitter.CreateView(0, 0,pContext->m_pNewViewClass, CSize(130, 50), pContext))
    {
    TRACE0("Failed to create first pane\n");
    return FALSE;
    }
    return TRUE;
    }

    Please help..........!
    thanks
    shachi


  2. #2
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: Splitter window

    It looks like your problem is that you are creating a splitter window with two panes but only creating one view. Create the second view and it should work.

    Wayne


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured