Solved

Splitter View With One Pane Showing CFormView

Posted on 2002-07-04
2
448 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

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

  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 …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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…

929 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

11 Experts available now in Live!

Get 1:1 Help Now