Author Topic: Enumerating Printers  (Read 111 times)

0 Members and 1 Guest are viewing this topic.

Online Brian

  • Paid Subscriber
  • Hero Member
  • *****
  • Posts: 1089
  • Hobby Programmer
Enumerating Printers
« on: February 09, 2019, 08:56:30 AM »
Looking through old code once again, I found this one I wrote 15 years(!) ago, for enumerating local and network printers, and I thought I would bring it up to date

I can't enumerate network printers here, but I am sure it worked when I wrote it, because I worked on a network

Should compile with no problem. Some code from Paul T and very probably other folks

Brian
« Last Edit: February 14, 2019, 06:45:49 AM by Brian Pugh »

Offline billhsln

  • Paid Subscriber
  • Hero Member
  • *****
  • Posts: 809
Re: Enumerating Printers
« Reply #1 on: February 09, 2019, 09:17:23 AM »
Will try and test it on a network on Tuesday.

Bill
When all else fails, get a bigger hammer.

Offline fasecero

  • Sr. Member
  • ****
  • Posts: 291
  • I'm sorry for my English.
Re: Enumerating Printers
« Reply #2 on: February 09, 2019, 08:59:19 PM »
One possible cause: you are setting up 'EnumPrintersA' with the wrong flag. You are using 22 which is decimal. Try using 0x22 instead which should be PRINTER_ENUM_SHARED + PRINTER_ENUM_LOCAL. I don't have a local network so maybe Bill can check on this.

Online Brian

  • Paid Subscriber
  • Hero Member
  • *****
  • Posts: 1089
  • Hobby Programmer
Re: Enumerating Printers
« Reply #3 on: February 14, 2019, 06:45:29 AM »
Thanks to Bill's testing, and Fasecero's remarks, I have now done a bit of a re-write of this program. See first post to re-download

Brian
« Last Edit: February 14, 2019, 11:02:44 AM by Brian Pugh »