Click here to Skip to main content
15,892,298 members
Articles / Desktop Programming / MFC

Reusable base class for SplitterWnd

Rate me:
Please Sign up or sign in to vote.
4.93/5 (77 votes)
2 Sep 2001CPOL3 min read 366.6K   11.6K   136  
A class derived from CSplitterWnd which makes splitting and switching of views simple.
// SplitterWndTestDoc.cpp : implementation of the CSplitterWndTestDoc class
//

#include "stdafx.h"
#include "SplitterWndTest.h"

#include "SplitterWndTestDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSplitterWndTestDoc

IMPLEMENT_DYNCREATE(CSplitterWndTestDoc, CDocument)

BEGIN_MESSAGE_MAP(CSplitterWndTestDoc, CDocument)
	//{{AFX_MSG_MAP(CSplitterWndTestDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSplitterWndTestDoc construction/destruction

CSplitterWndTestDoc::CSplitterWndTestDoc()
{
	// TODO: add one-time construction code here

}

CSplitterWndTestDoc::~CSplitterWndTestDoc()
{
}

BOOL CSplitterWndTestDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CSplitterWndTestDoc serialization

void CSplitterWndTestDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CSplitterWndTestDoc diagnostics

#ifdef _DEBUG
void CSplitterWndTestDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CSplitterWndTestDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSplitterWndTestDoc commands

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer
Switzerland Switzerland
Professional IT developer since 1983. First projects with Cobol, then Pascal, Modula2, C and since Visual C++ 1.0 also with C++ and today C#. Works since 1986 as Consultant, between 1990 and 2008 for Infobrain in Switzerland, from 2008 until 2013 for enValue (also Switzerland) and currently working for Comfone (Bern, Switzerland).

Married, two grown-up daughters, Hobbies : Paragliding, Orienteering, Mountainbiking, Photography

Comments and Discussions