Printer enumeration problem
Hello.
I have a problem with printer enumeration...The following code works ok on XP, but not on Win2k.
On Win2k network printers don't show up in the dropdown list, even though they are installed on the local machine. Printers that are physically connected to a port on the local machine, however, show up..!
Code:
if(EnumPrinters(PRINTER_ENUM_LOCAL|PRINTER_ENUM_CONNECTIONS, "", 5, (UCHAR*)pI1, sizeof(PRINTER_INFO_2)*MAX_PRINTERS, &lSize, &lRet)){
for(int i=0;i<(int)lRet && i<MAX_PRINTERS;i++){
SendMessage(GetDlgItem(hwThis, CBO_PRT), CB_ADDSTRING, 0, (long)pI1[i].pPrinterName);
strcpy(achPorts[i], pI1[i].pPortName);
if(!strcmp(pI1[i].pPrinterName, sil->achPrinter))
chIx=i;
}
}else
GetErr("EnumPrinters");