Hello. In C ++ Builder, I write a function (then add to the main module of the program) printer status definitions (turned on / off). While it does not work correctly. Tell me in which direction to dig. Maybe there are ready-made solutions? Thank.
- and how we determine that the printer is "on / off". We should not forget that printers are networked, but local ones and they need to be checked a little differently. - KoVadim
- Speech is about a local printer. I'm going to pull out the sign Enable / Disable via SetPrinter -> PRINTER___INFO_2 It will work I will write it off. If not there dig a signal. Thank. - gnomik
|
2 answers
To determine the status of the printer, you can use the features of WMI: Win32_Printer class . An example of working with WMI from C ++. Another feature: Print Spooler API .
|
Firstly, what is the printer connected via USB? LPT? ComPort? If the SWB, then you have to work)) It is easier to work with LPT and com ports, and there are a lot of components for them. If the SWB is available, you can request status using PJL (Printer Job Language). HP printers have a source code for the official. site, just for all HP C ++ printers (oddly enough, right?) In many cases, it’s suggested to work with the WriteFile, CreateFile, Readfile functions. Good luck!
|