Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

MFC Extension library : Enhanced print preview plug-in

, 24 May 2004
MFC Extension library : Enhanced print preview plug-in
eprintpreview.zip
EPrintPreview
EPrintPreview.def
EPrintPreview.dsp
EPrintPreview.dsw
res
pages.bmp
pages_to.bmp
PrevEnd.BMP
PreviewHome.BMP
PreviewNext.BMP
PrevPrevious.BMP
PrevPrint.BMP
PrevZoomin.bmp
PrevZoomout.BMP
prev_set.bmp
// EnumPrinters.h: interface for the CEnumPrinters class.
//
// Written By : R.I.Allen
// 3rd May 2002
// Roger.Allen@sirius-analytical.com
// You can use this source as you like, but without any warranties of any kind!
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ENUMPRINTERS_H__496315A4_5B64_11D6_AD8C_00B0D0652E95__INCLUDED_)
#define AFX_ENUMPRINTERS_H__496315A4_5B64_11D6_AD8C_00B0D0652E95__INCLUDED_

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

class CEnumPrinters  
{
public:
					CEnumPrinters();
	virtual			~CEnumPrinters();

	// returning gathered printer information
	int				GetPrinterCount();
	CString			GetPrinterName(int index);
	CString			GetPrinterLocation(int index);
	CString			GetPrinterShareName(int index);
	CString			GetPrinterPortName(int index);
	// enumerating printers on this and remote machines
	void			ReadLocalPrinters();
	// actually changing or configuring the printer
	bool			SetNewPrinter(const CString& PrinterName, const CString& PrinterSpooler, const CString& PrinterPort);
	bool			SetNewPrinter(int index);
	bool			SetPrintOrientation(HANDLE &hDevMode, int mode);
	int				GetPrintOrientation(HANDLE &hDevMode);
	// saving settings too/from the registry
	bool			SavePrinterSelection(HANDLE &hDevMode, HANDLE& hDevNames);
	bool			RestorePrinterSelection(HANDLE &hDevMode, HANDLE& hDevNames);
	// debug options only
#ifdef _DEBUG
	void			DumpHandles(HANDLE& hDevMode, HANDLE& hDevNames);
#endif
private:
	int				m_NumPrinters;
	CStringList		m_PrinterName;
	CStringList		m_PrinterLocation;
	CStringList		m_PrinterShareName;
	CStringList		m_PrinterPort;
};

#endif // !defined(AFX_ENUMPRINTERS_H__496315A4_5B64_11D6_AD8C_00B0D0652E95__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)

About the Author

Roger Allen
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.

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 25 May 2004
Article Copyright 2004 by Roger Allen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid