RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Printers.SetPrinter Function

Replaces the global instance of TPrinter that manages interaction with the printer.

Pascal
function SetPrinter(NewPrinter: TPrinter): TPrinter;
C++
TPrinter SetPrinter(TPrinter NewPrinter);

Printers

SetPrinter replaces the global TPrinter object with another TPrinter object. This allows applications to change the way they handle printing by substituting a TPrinter descendant for the default TPrinter object. 

NewPrinter is the new TPrinter object that replaces the current global TPrinter object. 

SetPrinter returns the previous global TPrinter object.

Note: The global TPrinter object is freed automatically when the application shuts down. After a call to SetPrinter, the printer that is returned is not automatically freed. It is the caller's responsibility to either free the return value, or replace it using another call to SetPrinter and to free the substitute printer that the second SetPrinter call returns.
SetPrinter is declared in the Printers unit. To use the SetPrinter function, add Printers to the uses clause of your unit (Delphi) or include Printers.hpp in the source file (C++) . 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!