Using the Printers Unit in Delphi
Asked Answered
B

1

5

I want to access the Printers Unit in Delphi XE7. I am not able to do this, because „the Printers Unit cannot be resolved“ as shown on this image:

enter image description here

As a beginner in Delphi, I don’t know what to do. Don’t judge me. Is there a way of adding a reference or something? Thank you.

Batiste answered 7/4, 2015 at 9:19 Comment(1)
The red squiggly line is from error insight, a functionality that doesn't work most of the time. Just deactivate this feature...Orphanage
T
8

In Delphi XE2, RTL/VCL/FMX unit names were updated with Unit Scope Names. So you have to either:

  1. use fully qualified unit names in your uses clause, like Vcl.Printers.

  2. go to Project Options -> Delphi Compiler -> Unit scope names and make sure Vcl is listed, then you can use just Printers in your uses clause.

A new Vcl project has the following default Unit Scope Names:

Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell`
Tedmann answered 7/4, 2015 at 9:31 Comment(3)
Thank you very much! Worked like a charm!Batiste
I kinda hate this whole Namespace idea in Delphi, i like it the old school way.Ikey
@Ikey Since the introduction of Firemonkey, namespaces were kinda inevitable.Bicolor

© 2022 - 2024 — McMap. All rights reserved.