ich will eine Datei per PrintDialog auslösen. Leider kommt nach dem PrintDialg folgende Fehlermeldung: Hier mein Quelltext:
Code: Alles auswählen
procedure TForm15.Button2Click(Sender: TObject);
 
 CONST VerticalSpacing = 150;
 CONST GeneralFontSize = 16;
 VAR PagePosition : Integer;
     Image: TImage;
 begin
 If PrintDialog1.Execute then
   begin
    MyPrinter.BeginDoc;
    Image.Picture.LoadFromFile('improves.jpg');
    MyPrinter.Canvas.Draw(10,10,Image.Picture.Graphic);
    Myprinter.enddoc;
   end;
 end;        
 Code: Alles auswählen
//Raise error if Printer.Printing is not Value
procedure TPrinter.CheckPrinting(Value: Boolean);
begin
  if Printing<>Value then
  begin
    if Value then
      raise EPrinter.Create('Printer is not printing')
    else
      raise Eprinter.Create('Printer is printing');
  end;
end;