enumprinters not returning network printers in win-7?

I've been using the enumprinters progress code example to get a list of available printers since windows NT... and I have some clients (and myself) running windows 7 without a problem, but I have a client who is now switching to win-7, and the enumprinters fails to include networked printers in the list of available printers.
Any ideas, what I am missing?

here's a portion of the code I am using...

SET-SIZE(pPrinterEnum) = 30.

RUN EnumPrinters{&A} IN THIS-PROCEDURE (6,"",2,
GET-POINTER-VALUE(pPrinterEnum),
GET-SIZE(pPrinterEnum),
OUTPUT pcbNeeded,
OUTPUT pcReturned,
OUTPUT RetValue).
/* RetValue will now be FALSE (=error) because we did not supply enough memory. But at least we know now how much
* memory was required (pcbNeeded) and also how many printers were found (pcReturned)
*/

/* no printers installed, then return (rare) */
IF pcbNeeded=0 THEN DO:
MESSAGE "No printers found" view-as alert-box error.
RETURN.
END.

/* Reset the size of pPrinterEnum to the correct size */
SET-SIZE(pPrinterEnum) = 0.
SET-SIZE(pPrinterEnum) = pcbNeeded.

/* The second call actually fills the pPrinterEnum structure */

RUN EnumPrinters{&A} IN fdyn-mother-hdl(6,"",2,
GET-POINTER-VALUE (pPrinterEnum),
GET-SIZE(pPrinterEnum),
OUTPUT pcbNeeded,
OUTPUT pcReturned,
OUTPUT RetValue).

/* pPrinterEnum holds a couple of PRINTER_INFO_2 records. The number of records is pcReturned.
* The number of bytes copied to pPrinterEnum is pcbNeeded. Size of one PRINTER_INFO_2 record is 84 bytes.
*/
DO i = 0 TO pcReturned - 1 :
SET-POINTER-VALUE(pPrinterInfo) = GET-POINTER-VALUE(pPrinterEnum) + (i * StructSize).
j = 5. /* 1 = host ?; 5 = \\host\printer name; 9 = printer share name ?; 13 = IP address; 17 = printer type ? */
SET-POINTER-VALUE(lpPrinterName) = GET-LONG(pPrinterInfo,j).
v-local-printers = (IF v-local-printers = ? then ""else v-local-printers + ",") + GET-STRING(lpPrinterName,1) .
END.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

EnumPrinters

Do this


RUN getkey
(input "devices", /* The section name */
input "", /* The key name */
input "win.ini", /* Name of ini file */
output ListOfPrinters). /* Returned stuff */

Works in Windows XP, 7, 8.