Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Stingray Foundation Library User's Guide

9.5 Printers

The CPrinterConfig class provides a way to identify a printer and create a device context for it using a particular configuration. The Windows API also provides functions for directly accessing printers and the print spooler. The Windows API function OpenPrinter() returns a handle for a printer that can be used in conjunction with several other functions such as ReadPrinter(), WritePrinter(), GetJob(), PrinterProperties(), and DeletePrinter(). The CPrinter class encapsulates a printer handle and the Windows API functions for accessing printers and the printer spooler.

The CPrinter class implements an Open() method, which takes the name of a printer and calls the OpenPrinter() Windows API function in order to get back a valid printer handle. The CPrinter class also has the Attach() and Detach() methods for assigning an existing printer handle to a printer object. The remaining methods in this class are simple wrappers for Windows API functions that operate on a printer handle.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.