Description:
This function gets a list of ports connected to the print queue for the print object or applications. This function is used by the print object to determine if some menu items can be enabled based on the type of printer port connected to a print queue.
#define INCL_SPL #define INCL_SPLBIDI #include <os2.h> PSZ pszComputerName; /* Name of the computer on which pszQueueName exists. */ PSZ pszQueueName; /* Name of print queue. */ ULONG ulLevel; /* Level of information to return. */ PVOID pBuf; /* Receives the GETPORTFROMQ data structure. */ ULONG cbBuf; /* Length of buffer pointed to by pBuf, in bytes. */ ULONG pcbNeeded; /* Receives length, in bytes, of buffer needed to return all port data. */ ULONG rc; /* Return codes. */ rc = SplGetPortFromQ(pszComputerName, pszQueueName, ulLevel, pBuf, cbBuf, pcbNeeded);