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

x
?
Solved

CSplitterWnd w/ non-CView derived panes

Posted on 1998-04-11
2
Medium Priority
?
659 Views
Last Modified: 2013-11-20
How do you create a CSplitterWnd that has as its subpanes non CView derived classes?
Specifically, I want a CSplitterWnd with 2 columns.  In the first column is a CTreeCtrl derived class, and in the second column is a CListView derived class.
When I try and use these classes directly in calls to CSplitterWnd::CreateView they aren't created and the splitter doesn't redraw the splitter bar correctly.
0
Comment
Question by:mdouglass
[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
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 800 total points
ID: 1317635
What you can do is to create a class derived from CView and all it does is be a holder to a control. For example, you can use something like this:

  class CLeftView : public CView
  {
    public:
      CTreeCtrl* m_TreeCtrl;
    // rest
  }

Then in the CLeftView::OnCreate(), create the m_TreeCtrl. Then when the CLeftView receives the following messages: WM_SETFOCUS and WM_SIZE, you need to something to the control. For focus, set the focus to the tree control. For sizing, resize the control to the entire size of the client area of the view. That way, you can make any control behave like a view.

In the long run, this will be easier.
0
 

Author Comment

by:mdouglass
ID: 1317636
Thanks, that seems to work great!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

609 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