#1 2012-10-08 19:40:27

dougwoodrow
Member
From: UK
Registered: 2012-10-04
Posts: 36

Better Printers.pas?

The Delphi 7 version of Printers.pas - including the one as patched in this SynopseRTL - does not use the recommended Windows GetDefaultPrinter API, and this causes problems in certain terminal services situations, where the application is unable to find the user's default printer.

And there's also a problem with the default printer settings, as explained by Fernando Ruiz Casas on QualityCentral.

Has anyone here got a "definitive" version of Printers.pas that fixes all known issues?  It would be good to have all the fixes in this library.

Offline

#2 2012-10-09 05:48:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,692
Website

Re: Better Printers.pas?

It is a good idea.

Main problem with the default implementation is that it does not work in a service.
But IMHO a server should have the printer name set in its configuration, since there is no GUI to specify an alternative.

The enhanced RTL has some additional properties in respect to the default version, to handle duplex and black & white printing settings for instance.
This is another enhancement, and unit interface conscious break.
But a nice feature needed in some apps.

Offline

#3 2012-10-09 09:27:08

dougwoodrow
Member
From: UK
Registered: 2012-10-04
Posts: 36

Re: Better Printers.pas?

There appears to be a good solution on "Steve's Blog" - originally adapted Delphi5 version but there weren't many changes for Delphi7.
I notice he doesn't attempt to load GetDefaultPrinter dynamically however so it will need re-writing to work with OS's that do not have the API.

Offline

#4 2012-10-09 12:27:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,692
Website

Re: Better Printers.pas?

Who will run Windows 95/98/Me nowadays?

Offline

#5 2012-10-09 14:07:59

dougwoodrow
Member
From: UK
Registered: 2012-10-04
Posts: 36

Re: Better Printers.pas?

ab wrote:

Who will run Windows 95/98/Me nowadays?

Good question smile
I've merged Steve's version of printers.pas with yours; would you like me to email you a copy?

Offline

#6 2012-10-09 14:28:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,692
Website

Re: Better Printers.pas?

you can at webcontact01 at synopse dot info

Thanks!

Offline

Board footer

Powered by FluxBB