Recent

Author Topic: [Solved] Printing problems  (Read 703 times)

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
[Solved] Printing problems
« on: April 24, 2021, 05:51:02 pm »
Hi, I have this line of code:

Code: Pascal  [Select][+][-]
  1. lbImpresoras.Assign(Printer.Printers);
  2.  

lblImpresoras is created, the missing is Printer.Printers.

In the uses section I've added Printers unit. It contains a variable called Printer of TPrinter.

I'm using the exact line of code in another program and it works, but here gives me an access violation.

I'm missing some initialization or something?
« Last Edit: April 24, 2021, 06:15:35 pm by lainz »

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Printing problems
« Reply #1 on: April 24, 2021, 06:04:45 pm »
Hi!

You need also

Code: Pascal  [Select][+][-]
  1. uses ...., Printer4Lazarus;

Winni

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Printing problems
« Reply #2 on: April 24, 2021, 06:15:24 pm »
Thankyou  :)

It works now.

 

TinyPortal © 2005-2018