Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

3 way splitter window problem

Posted on 2001-07-30
6
Medium Priority
?
301 Views
Last Modified: 2013-11-20
Hi,
i'm trying to create a 3 way static splitter window and the app is crashing.
the code:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
     if(!m_wndSplitter1.CreateStatic(this,2,1)||
          !(m_wndSplitter1.CreateView(0,
          0,
          RUNTIME_CLASS (CRwrSimView),
          CSize(0,128),
          pContext)) ||
          !(m_wndSplitter2.CreateStatic     (&m_wndSplitter1,1,2,WS_CHILD|WS_VISIBLE|WS_BORDER,
  m_wndSplitter1.IdFromRowCol(1,0))||
!(m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS (CLstVwInfraView), CSize(0,128),
               pContext)||
             !(m_wndSplitter2.CreateView(0,1,RUNTIME_CLASS (CRwrSimView), CSize(0,0),
               pContext)))))
  return FALSE;      
     
return TRUE;
}
the app is crashing in

CWnd* CSplitterWnd::GetPane(int row, int col) const
{
     ASSERT_VALID(this);

     CWnd* pView = GetDlgItem(IdFromRowCol(row, col));
     ASSERT(pView != NULL);  // panes can be a CWnd, but are usually CViews
     return pView;
}
the CSplitterWnd is the parent one(m_wndSplitter1)
thanks.

0
Comment
Question by:alons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 6333292
You must not override GetPane... Just call it!

CMyView* pView= (CMyView*)m_pSplitter->GetPane( row, clm );

-- Dan
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6333296
so by looking at your code you have

<pre>
          CRwrSimView
_____________________________
                |
CLstVwInfraView | CRwrSimView
                |            
</pre>

the only pane you can access from m_wndSplitter1 is the top pane you have to use the other splitter to access the bottom panes


0
 
LVL 31

Accepted Solution

by:
Zoppo earned 200 total points
ID: 6333312
Hi alons,

if the code you pasted here is an exacty copy of the code you're using you have a parentesis-problem in this
condition:

   !(m_wndSplitter2.CreateStatic     (&m_wndSplitter1,1,2,WS_CHILD|WS_VISIBLE|WS_BORDER,
                      m_wndSplitter1.IdFromRowCol(1,0))||
   !(m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS (CLstVwInfraView), CSize(0,128),
   pContext)||
                                 !(m_wndSplitter2.CreateView(0,1,RUNTIME_CLASS (CRwrSimView), CSize(0,0),
                                   pContext)))))

if the CreateStatic(...) returns TRUE the whole statement including the both CreateView()-calls evaluates to TRUE without the CreateView()-calls executed.

I would suggest that you write your code a bit better readable ... this may preserves bugs.

hope that helps,

ZOPPO
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 49

Expert Comment

by:DanRollins
ID: 6333314
<i>but alons should not try to instantiate CSplitterWnd code... If anything, he could derive a class from it...</i>

-- Dan
0
 

Author Comment

by:alons
ID: 6333342
if i had more points - you are the winner.
thanks
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 6333352
you're welcome...

have a nice day,

regards,

ZOPPO
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question