Click here to Skip to main content
15,892,281 members
Articles / Programming Languages / C++

Using CodeProject - A Day In the Life of an Application - Part 3 of 5

Rate me:
Please Sign up or sign in to vote.
4.63/5 (20 votes)
27 Jan 2007CPOL14 min read 43.3K   436   17  
The right way to code using CodeProject for occasional support
// SDIMultiApp1View.h : interface of the CSDIMultiApp1View class
//

#pragma once

#define _NO_CONTENT_

#ifndef _NO_CONTENT_
#include "GridCtrl.h"
#endif

#include "SDIMultiApp1Doc.h"

class CSDIMultiApp1View : public CView
{
protected: // create from serialization only
	CSDIMultiApp1View();
	DECLARE_DYNCREATE(CSDIMultiApp1View)

private:
#ifndef _NO_CONTENT_
	CGridCtrl* m_pGridCtrl;
#endif

public:
#ifndef _NO_CONTENT_
	// give other parts of the program a method for retrieving the grid control.
	// you may not need this right away, but it sure will be convenient when 
	// it's there becaus ethat's one less file you have to check out of source 
	// control to change later.
	/// Retrieves the current grid control's pointer
	CGridCtrl* GetGridControl() { return m_pGridCtrl; };
#endif

// Attributes
public:
	CSDIMultiApp1Doc* GetDocument() const;

// Operations
public:

// Overrides
public:
	// While we don't need OnDraw() for our own purposes, we DO need it in 
	// order to compile because in VS2005, because the base class' version is 
	// pure virtual, making CView an abstract class. However, we can simply 
	// give it an empty body here in the header file to help keep our CPP file 
	// clean of unwanted code.
	virtual void OnDraw(CDC* pDC) {};
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// Implementation
public:
	virtual ~CSDIMultiApp1View();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
	virtual void OnInitialUpdate();
};

#ifndef _DEBUG  // debug version in SDIMultiApp1View.cpp
inline CSDIMultiApp1Doc* CSDIMultiApp1View::GetDocument() const
   { return reinterpret_cast<CSDIMultiApp1Doc*>(m_pDocument); }
#endif

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
Software Developer (Senior) Paddedwall Software
United States United States
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.

My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.

Comments and Discussions