Board index » delphi » Printer.Printers lists nothing

Printer.Printers lists nothing

Hi all,

(I also posted this to the VCL components/using newsgroup)

We have a customer using an HP3100 All-In-One printer/fax/copier.  When our
program does a Printer.Printers, it returns nothing.

So...  I started putting debugging information inside the Printer.Printers
(GetPrinters) call.  What I've discovered is that it simply won't return the
names in the 2nd EnumPrinters call.  The first call succeeds just fine, but
the 2nd call dies (where it gets the printer names) and returns an error
code 124 (ERROR_INVALID_LEVEL).  It is using Level 5, since it is a Win98 SE
OS.

I rewrote a portion of the GetPrinters routine to use Level 2
(PRINTER_INFO_2), and then it actually works.

Can anyone tell me what is causing this to fail?  Would this be a Printer
Driver issue (we're using the latest driver)?

It prints just fine from all other Windows Apps.  I also added a "Generic
Text on FILE:" printer, just to see if it would show up, and it also does
not.  That makes me think that perhaps this is not printer related at all.

Any help would be greatly appreciated.

 

Re:Printer.Printers lists nothing


Welcome to the gloriously unsupported world of printers.pas.

The plain obvious bugs that you've found don't appear to be on Borland's
list of things to do.  Dead in the sand and sod the customer.  It took
me ages just to try to get the source from them then some kind person in
alt.lang.delphi supplied it.  Email after e-mail totally ignored.

If my ISP's FTP is working try <www.eminent.demon.co.uk/delph.zip> for a
hacked printers.pas and some documentation.

In article <3ab289af_1@dnews>, Jeremy M Praay
<jere...@questsoftware.com> writes

Quote
>Hi all,

>(I also posted this to the VCL components/using newsgroup)

>We have a customer using an HP3100 All-In-One printer/fax/copier.  When our
>program does a Printer.Printers, it returns nothing.

>So...  I started putting debugging information inside the Printer.Printers
>(GetPrinters) call.  What I've discovered is that it simply won't return the
>names in the 2nd EnumPrinters call.  The first call succeeds just fine, but
>the 2nd call dies (where it gets the printer names) and returns an error
>code 124 (ERROR_INVALID_LEVEL).  It is using Level 5, since it is a Win98 SE
>OS.

>I rewrote a portion of the GetPrinters routine to use Level 2
>(PRINTER_INFO_2), and then it actually works.

>Can anyone tell me what is causing this to fail?  Would this be a Printer
>Driver issue (we're using the latest driver)?

>It prints just fine from all other Windows Apps.  I also added a "Generic
>Text on FILE:" printer, just to see if it would show up, and it also does
>not.  That makes me think that perhaps this is not printer related at all.

>Any help would be greatly appreciated.

--
PETER FOX Not the same since the bookshop idea was shelved
2 Tees Close, Witham, Essex.            pe...@eminent.demon.co.uk
Gravity beer in Essex            <http://www.eminent.demon.co.uk>

Re:Printer.Printers lists nothing


Quote
>If my ISP's FTP is working try <www.eminent.demon.co.uk/delph.zip> for a
>hacked printers.pas and some documentation.

Sorry:
Wrong URL
Should be <www.eminent.demon.co.uk/delph.htm>

--
PETER FOX Not the same since the deckchair business folded
2 Tees Close, Witham, Essex.            pe...@eminent.demon.co.uk
Gravity beer in Essex            <http://www.eminent.demon.co.uk>

Re:Printer.Printers lists nothing


Quote
"Peter Fox" <pe...@eminent.demon.co.uk> wrote in message

news:XmKV8IAlyys6EwQm@eminent.demon.co.uk...

Quote
> >If my ISP's FTP is working try <www.eminent.demon.co.uk/delph.zip> for a
> >hacked printers.pas and some documentation.
> Sorry:
> Wrong URL
> Should be <www.eminent.demon.co.uk/delph.htm>

3rd time's a charm :) (here's the working URL)

www.eminent.demon.co.uk/delphi.htm

Other Threads