Solved

Splitter View With One Pane Showing CFormView

Posted on 2002-07-04
2
446 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
2 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7129637
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 350 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

705 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

17 Experts available now in Live!

Get 1:1 Help Now