YOU CAN CODE!

 

With The Case Of UCanCode.net  Release The Power OF  Visual C++ !   HomeProducts | PurchaseSupport | Downloads  
View in English
View in Japanese
View in
참고
View in Français
View in Italiano
View in 中文(繁體)
Download Evaluation
Pricing & Purchase?
E-XD++Visual C++/ MFC Products
Overview
Features Tour 
Electronic Form Solution
Visualization & HMI Solution
Power system HMI Solution
CAD Drawing and Printing Solution

Bar code labeling Solution
Workflow Solution

Coal industry HMI Solution
Instrumentation Gauge Solution

Report Printing Solution
Graphical modeling Solution
GIS mapping solution

Visio graphics solution
Industrial control SCADA &HMI Solution
BPM business process Solution

Industrial monitoring Solution
Flowchart and diagramming Solution
Organization Diagram Solution

Graphic editor Source Code
UML drawing editor Source Code
Map Diagramming Solution

Architectural Graphic Drawing Solution
Request Evaluation
Purchase
ActiveX COM Products
Overview
Download
Purchase
Technical Support
  General Q & A
Discussion Board
Contact Us

Links

Get Ready to Unleash the Power of UCanCode .NET


UCanCode Software focuses on general application software development. We provide complete solution for developers. No matter you want to develop a simple database workflow application, or an large flow/diagram based system, our product will provide a complete solution for you. Our product had been used by hundreds of top companies around the world!

"100% source code provided! Free you from not daring to use components because of unable to master the key technology of components!"


VC++ Tool: Printer Settings - Change, Store and Load Printer Setting, Paper Orientation 

By Franz Brunner

Description

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.


#include "PrinterSettings.h"

class CPrnsetupDlg : public CDialog
{
public:
	CPrinterSettings m_prn_setting1;
	CPrinterSettings m_prn_setting2;

To get a copy of the original MFC printer settings call CopyDefaultMfcPrinter().


	// Get MFC's default printer
	m_prn_setting1.CopyDefaultMfcPrinter();
	m_prn_setting2.CopyDefaultMfcPrinter();

To let the user change the settings e.g. paper orientation or printer resolution call PrinterSetup( CWnd* pWnd ).


	m_prn_setting1.PrinterSetup(this);

To cause MFC to use your settings call SetThisPrinter().


	// make m_prn_setting1 the MFC standard printer
	m_prn_setting1.SetThisPrinter();

	// later you may call RestorePrinter() to
	// restore earlier settings.

To load or save your settings call Save(LPCTSTR filename ) or Load(LPCTSTR filename ).

// Save our settings to file
m_prn_setting1.Save( "testfilename");

...
...

// load settings, store them in m_prn_settings1
m_prn_setting1.Load( "testfilename" ));

Downloads

Download demo project - 17 Kb

The name of the project is "prnsetup.dsw" (build with VC++ 6 )

Download source - 5 Kb

The source files are named: PrinterSettings.h and PrinterSettings.cpp

 

 

Copyright ?1998-2024 UCanCode.Net Software , all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster@ucancode.net