How to get the current printer port name ?

Category: VC/MFC -> Foundation Classes Author: tingji02 Date: 2009-05-29 18:51:44
 
tingji02
2009-05-29 18:51:44
How to get the current printer port name ?
zm0691
2009-05-29 19:02:55
EnumPrinters   (dwFlags,   NULL,   2,   (LPBYTE)   pPrinters,
                    cbPrinters,   & cbPrinters,   & cReturned)
for   (i   =   0;   i   <   cReturned;   i ++)
{
strcpy   (szDeviceName,   (pPrinters   +   i) - > pPrinterName);
strcpy   (szPort, (pPrinters   +   i) - > pPortName);
strcpy   (szDriverName,   (pPrinters   +   i) - > pDriverName);
memcpy   (& InitData, (pPrinters   +   i) - > pDevMode,   sizeof (DEVMODE));
}