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

Plug-in DLLs and Menu Interfaces

Rate me:
Please Sign up or sign in to vote.
4.76/5 (20 votes)
14 Sep 2005CPOL5 min read 78.6K   3.3K   104  
An article on installing a menu interface for a load-on-demand DLL.
// TargetAppView.cpp : implementation of the CTargetAppView class
//
/*
** Copyright 2005 by Michael Bergman
** See the enclose ReadMe.txt file for terms 
** conditions. 
*/


#include "stdafx.h"
#include "TargetApp.h"

#include "TargetAppDoc.h"
#include "TargetAppView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CTargetAppView

IMPLEMENT_DYNCREATE(CTargetAppView, CEditView)

BEGIN_MESSAGE_MAP(CTargetAppView, CEditView)
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
END_MESSAGE_MAP()

// CTargetAppView construction/destruction

CTargetAppView::CTargetAppView()
{
	// TODO: add construction code here

}

CTargetAppView::~CTargetAppView()
{
}

BOOL CTargetAppView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	BOOL bPreCreated = CEditView::PreCreateWindow(cs);
	cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL);	// Enable word-wrapping

	return bPreCreated;
}


// CTargetAppView printing

BOOL CTargetAppView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default CEditView preparation
	return CEditView::OnPreparePrinting(pInfo);
}

void CTargetAppView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView begin printing
	CEditView::OnBeginPrinting(pDC, pInfo);
}

void CTargetAppView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView end printing
	CEditView::OnEndPrinting(pDC, pInfo);
}


// CTargetAppView diagnostics

#ifdef _DEBUG
void CTargetAppView::AssertValid() const
{
	CEditView::AssertValid();
}

void CTargetAppView::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}

CTargetAppDoc* CTargetAppView::GetDocument() const // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTargetAppDoc)));
	return (CTargetAppDoc*)m_pDocument;
}
#endif //_DEBUG


// CTargetAppView message handlers

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)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions