The sample code in the following figure shows how to display the job properties dialog. All the parameters required are available from the PRQINFO3 structure returned by SplEnumQueue or SplQueryQueue.
In the case of printer pooling, the pszPrinters field of the PRQINFO3 structure contains a list of device names, separated by commas. It is sufficient to choose the first printer in the list because the printer object ensures that the configuration of each spooled printer is the same.
Note: It is possible that the printer driver now uses a larger buffer for the job properties than the application is expecting. This occurs when a new version of a printer driver that supports some additional features is installed. In this case, the application must discard the existing document job properties, after a confirmation from the user, and query the printer driver for its device defaults, using the DPDM_QUERYJOBPROPS parameter to DevPostDeviceModes.
#define INCL_DEV #define INCL_DOS #include <os2.h> #include <memory.h> { ULONG ulrc=FALSE; HAB hab; PPRQINFO3 pprq3Queue; /* From SplEnumQueue or SplQueryQueue */ PSZ pszDriverName,pszDeviceName,pszTmp; HDC hdc=NULL; LONG cbBuf; /* Use the first device name in the PRQINFO3 structure */ pszTmp = strchr(pprq3Queue->pszPrinters, ','); if (pszTmp) *pszTmp = '\0'; /* Use just the driver name from the driver.device string */ pszDeviceName = strchr(pprq3Queue->pszDriverName, '.'); if (pszDeviceName) { *pszDeviceName = '\0'; pszDeviceName++; } /* Check size of buffer required for job properties */ cbBuf = DevPostDeviceModes( hab, (PDRIVDATA)NULL, pprq3Queue->pszDriverName, pszDeviceName, pprq3Queue->pszPrinters, DPDM_POSTJOBPROP ); /* Return error to caller */ if (cbBuf<=0) return(cbBuf); /* Return BUFFER TOO SMALL error to caller */ if (cbBuf > pprq3Queue->pDriverData->cb) return(DPDM_ERROR); /* Display job properties dialog & get updated job properties from driver */ ulrc = DevPostDeviceModes( hab, pprq3Queue->pDriverData, pprq3Queue->pszDriverName, pszDeviceName, pprq3Queue->pszPrinters, DPDM_POSTJOBPROP ); return(ulrc); }