Local/Network printer test.
Hi,
RbPro 11.06, Delphi 2006, Vista SP2
In ppPrintr.pas procedure TppPrinterList.BuildPrinterList:
The test for local/network printers under win32 is not correct.
lbIsLocal := (lPrinterInfo4.Attributes <>
PRINTER_ATTRIBUTE_NETWORK);
it should be
lbIsLocal := (lPrinterInfo4.Attributes and
PRINTER_ATTRIBUTE_LOCAL) > 0;
I guess it's a documentation issue. The older Win SDK help from Delphi 2006
states that the attributes field can only be
PRINTER_ATTRIBUTE_LOCAL or PRINTER_ATTRIBUTE_NETWORK.
But the latest MSDN
(http://msdn.microsoft.com/en-us/library/dd162847(VS.85).aspx) says:
Attributes can also contain values that are defined in the Attributes
field of PRINTER_INFO_2.
A minor issue of course, IsLocal is only used to have different printer
icons in the printer setup dialog.
MSDN also states that PRINTER_INFO_4 needs at minimum Windows 2000, so if
somebody is still on NT4...
Regards,
Max Paay
Quadrant Software bv.
The Netherlands.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
RbPro 11.06, Delphi 2006, Vista SP2
In ppPrintr.pas procedure TppPrinterList.BuildPrinterList:
The test for local/network printers under win32 is not correct.
lbIsLocal := (lPrinterInfo4.Attributes <>
PRINTER_ATTRIBUTE_NETWORK);
it should be
lbIsLocal := (lPrinterInfo4.Attributes and
PRINTER_ATTRIBUTE_LOCAL) > 0;
I guess it's a documentation issue. The older Win SDK help from Delphi 2006
states that the attributes field can only be
PRINTER_ATTRIBUTE_LOCAL or PRINTER_ATTRIBUTE_NETWORK.
But the latest MSDN
(http://msdn.microsoft.com/en-us/library/dd162847(VS.85).aspx) says:
Attributes can also contain values that are defined in the Attributes
field of PRINTER_INFO_2.
A minor issue of course, IsLocal is only used to have different printer
icons in the printer setup dialog.
MSDN also states that PRINTER_INFO_4 needs at minimum Windows 2000, so if
somebody is still on NT4...
Regards,
Max Paay
Quadrant Software bv.
The Netherlands.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4514 (20091016) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
This discussion has been closed.
Comments
Thanks for the information. We will research and make these changes for the
next release of ReportBuilder.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com