Solved

Printing Error

Posted on 2000-02-23
2
282 Views
Last Modified: 2010-04-04
I try to print with something like this:

Var
prn:TPrinter;
begin
Prn.BeginDoc;
prn.canvas.draw(10,10,Image1.Picture.Graphic);
prn.EndDoc;
end;

or like this:

Var
prn:TPrinter;
begin
prn:=TPrinter.Create;
Prn.BeginDoc;
prn.canvas.draw(10,10,Image1.Picture.Graphic);
prn.EndDoc;
prn.Free;
end;

but it stops with access violation error. I tried to trace the problematic line(by commenting all text except one line each time) and found that the prn.BeginDoc; causes the AV error in both cases.

please help!
0
Comment
Question by:duke_n
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
TAZI earned 10 total points
ID: 2550420
Hi...

Make sure that you've added the printers unit to your uses clause above.

uses
  Printers;

try this

Printer.BeginDoc;
 ....
   .... (your text here)
      .....
Printer.EndDoc;

don't declare prn as type TPrinter.

Regards
Tazi

 
0
 
LVL 1

Author Comment

by:duke_n
ID: 2550504
Thanx Greatly.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question