Главная страница | назад





Article #17052: Using an instance of TPrinter

 Question and Answer Database
FAQ2052D.txt Using an instance of TPrinter
Category :VCL
Platform :All
Product :All 32 bit
Question:
When I create an instance of TPrinter using TPrinter.Create, I
get an exception. How can I get around this?
Answer:
There is no need to create an instance of TPrinter
using TPrinter.Create, as an instance of TPrinter (called Printer)
is automatically created when you use the Printers unit.
Example:
uses Printers;
procedure TForm1.Button1Click(Sender: TObject);
begin
Printer.BeginDoc;
Printer.Canvas.TextOut(100, 100, 'Hello World!');
Printer.EndDoc;
end;
7/16/98 4:31:28 PM

Last Modified: 01-SEP-99