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
Will try and test it on a network on Tuesday.
Bill
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.
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