Solved

CSplitterWnd w/ non-CView derived panes

Posted on 1998-04-11
2
621 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
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to include alternate header placement and naming 5 66
cat dog challenge 18 124
wait notify demo infinite loop 3 98
Sed question 2 70
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now