Solved

Splitter View With One Pane Showing CFormView

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Focus not getting shifted out of  editbox 2 63
Getting IP address 8 81
C++ Class Serialization, Encapsulation and Formatted Output 8 69
Precision Problem in C++ 7 33
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

803 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