Settings - Change, Store and Load Printer Setting,
By Franz Brunner
Several years ago I had
to implement the ability to change
the printer and it's settings
from within a program. The output had to be distributed to
3 or more printers.
The settings had to be
stored to disk to be able to be loaded. It was desired to
conform to the MFC Framework.
How to use
Declare the class
CPrinterSettings in a CDocument derived class or wherever
you find it useful.
class CPrnsetupDlg : public CDialog
To get a copy of the
original MFC printer settings
To let the user change the settings
e.g. paper orientation
or printer resolution
call PrinterSetup( CWnd* pWnd ).
To cause MFC
to use your settings call SetThisPrinter().
To load or save your
settings call Save(LPCTSTR filename ) or Load(LPCTSTR
m_prn_setting1.Load( "testfilename" ));
demo project - 17 Kb
The name of the project
is "prnsetup.dsw" (build with VC++
source - 5 Kb
files are named: PrinterSettings.h and PrinterSettings.cpp