?
Solved

Printing Error

Posted on 2000-02-23
2
Medium Priority
?
286 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 40 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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