Click here to Skip to main content
15,897,273 members
Articles / Desktop Programming / MFC

MFC Print preview extension DLL for dialogs

Rate me:
Please Sign up or sign in to vote.
4.74/5 (29 votes)
26 Dec 2002CPOL2 min read 277.3K   9.6K   53  
An MFC extension library, so your dialogs can have easy print/print preview support.
// DialogPrintPreviewDlg.h : header file
//

#if !defined(AFX_DIALOGPRINTPREVIEWDLG_H__CC76967C_E5B1_4E55_9718_48DABCEC75F6__INCLUDED_)
#define AFX_DIALOGPRINTPREVIEWDLG_H__CC76967C_E5B1_4E55_9718_48DABCEC75F6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CDialogPrintPreviewDlg dialog

class CDialogPrintPreviewDlg : public CPrintPreviewDialog
{
// Construction
public:
	CDialogPrintPreviewDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CDialogPrintPreviewDlg)
	enum { IDD = IDD_DIALOGPRINTPREVIEW_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDialogPrintPreviewDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CDialogPrintPreviewDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DIALOGPRINTPREVIEWDLG_H__CC76967C_E5B1_4E55_9718_48DABCEC75F6__INCLUDED_)

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) Sirius Analytical Instruments
United Kingdom United Kingdom
A research and development programmer working for a pharmaceutical instrument company for the past 17 years.

I am one of those lucky people who enjoys his work and spends more time than he should either doing work or reseaching new stuff. I can also be found on playing DDO on the Cannith server (Send a tell to "Maetrim" who is my current main)

I am also a keep fit fanatic, doing cross country running and am seriously into [url]http://www.ryushinkan.co.uk/[/url] Karate at this time of my life, training from 4-6 times a week and recently achieved my 1st Dan after 6 years.

Comments and Discussions