?
Solved

Splitter View With One Pane Showing CFormView

Posted on 2002-07-04
2
Medium Priority
?
454 Views
Last Modified: 2008-03-17
Hi,
I'm trying to create a splitter with a SDI architecture and with one side of the pane showing the main document and then another pane showing a CFormView object. Is that possible ?If so, how do i do it ? any sample ?
Thanks a lot.
0
Comment
Question by:Hsiang2k
[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 23

Expert Comment

by:Roshan Davis
ID: 7129637
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 1400 total points
ID: 7129670
If you use the AppWizard to create an SDI, near the end you can choose Explorer Style which provides a splitter and creates two views for you.  You can then create your own views and just modify the part in MyApp.cpp where you see:

     CSingleDocTemplate* pDocTemplate;
     pDocTemplate = new CSingleDocTemplate(
          IDR_MAINFRAME,
          RUNTIME_CLASS(CMyDoc),
          RUNTIME_CLASS(CMainFrame),       // main SDI frame window
          RUNTIME_CLASS(CLeftView));
     AddDocTemplate(pDocTemplate);

so that it uses to setup your views.  Also modify the place in CMainFraem where it creates the views.  It looks like this:

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
     CCreateContext* pContext)
{
     // create splitter window
     if (!m_wndSplitter.CreateStatic(this, 1, 2))
          return FALSE;

     if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(100, 100), pContext) ||
          !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext))
     {
          m_wndSplitter.DestroyWindow();
          return FALSE;
     }

     return TRUE;
}

Change it to use your own views.

-- Dan
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

764 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