BOOL AddJob( HANDLE hPrinter, /* handle of printer object */ DWORD cLevel, /* data-structure level */ LPBYTE pData, /* address of data-structure array */ DWORD cbBuf, /* count of bytes in array */ LPDWORD pcbNeeded, /* address of variable that contains */ /* count of bytes required */ );
Returns the full path name of a file that can be used to store a print job.
hPrinter | Identifies the printer for which the print job is intended. |
cLevel | Specifies the version of the structure to which pData points. The value of this parameter must be 1. |
pData | Points to an ADDJOB_INFO_1 structure. |
cbBuf | Specifies the size, in bytes, of the buffer pointed to by pData. |
pcbNeeded | Points to a variable that will be updated with the number of bytes copied or the number of bytes required. If cbBuf is less than the required number of bytes, pcbNeeded specifies the number of bytes required; if cbBuf is large enough, pcbNeeded specifies the number of bytes copied. |
The filename returned in the ADDJOB_INFO_1 structure can be opened with the CreateFile function. Once the file is opened, data can be written to the file by calling the WriteFile function.
The job identifier returned in the ADDJOB_INFO_1 structure can be passed to the SetJob and ScheduleJob functions in order to control the print job.
The AddJob and ScheduleJob functions are not currently required for basic printing, but should be supported if at all possible. Currently, Windows 95 uses StartDocPrinter and EndDocPrinter for job submission and scheduling.