How to get the Printer Driver

  • Thread starter Thread starter Ed.
  • Start date Start date
E

Ed.

Hello All,
I am using vb6 and need to get the 'printer driver' for some crw printer
calls I need to make. The problem is that it appears inconsistent between
the printer object and the API. I am using the GetPrinter API to get the
printer driver. The driver it returns is "HP Laserjet 5". If I use the
printer object (printer.drivername) it returns "winspool". Which is
actually the driver? Which do I trust? For various reasons the printer
object is not an ideal method for me, the api is preferable.

All the best,
- Ed.
 
Ed. said:
Hello All,
I am using vb6 and need to get the 'printer driver' for some crw printer
calls I need to make. The problem is that it appears inconsistent between
the printer object and the API. I am using the GetPrinter API to get the
printer driver. The driver it returns is "HP Laserjet 5". If I use the
printer object (printer.drivername) it returns "winspool". Which is
actually the driver? Which do I trust? For various reasons the printer
object is not an ideal method for me, the api is preferable.

All the best,
- Ed.

I think you are comparing Printer.devicename to Printer.drivername. They
are two different properties.

J
 
Hello,
Thanks for the feedback,
I can see it may appear that way, but no, this is not the case. What I am
doing is this..
1.API Method.
I use GetPrinterInfo requesting PRINTER_INFO_2 with the following call.
x = GetPrinter(Handle, 2, t(0), need, need)

t(4) should be Driver Name. The API returns "HP Laserjet 5" for this
field. The devicename happens to be \\mark-pc\HP LaserJet 5 (this printer
is on a different PC)

2. Printer object method
I use printer.drivername, and that returns "winspool". This is different
to the devicename retrieved from the WINAPI.

Not sure what the issue is exactly.

All the best,
- Ed
 
Back
Top