SplQmWrite
Appearance
SplQmWrite writes a buffer of data to the spool file for the print job.
Syntax
rc = SplQmWrite(hspl, lCount, pData)
Parameters
- hspl (HSPL) - input
- Spooler handle.
- lCount (LONG) - input
- Length in bytes.
- This is the length of pData; it must not be less than 1 or greater than 65 535. Data that is longer than this must be written by two or more calls.
- pData (PVOID) - input
- Buffer of data to be written to the spool file.
Return Code
- rc (BOOL) - returns
- Success indicator.
- TRUE Successful completion
- FALSE Error occurred.
- Error Conditions
- Possible returns from WinGetLastError
- PMERR_INVALID_PARM (0x1303) A parameter to the function contained invalid data.
- PMERR_BASE_ERROR (0x2006) An OS/2 base error has occurred. The base error code can be accessed using the OffBinaryData field of the ERRINFO structure returned by WinGetErrorInfo.
- PMERR_SPL_INV_LENGTH_OR_COUNT (0x401A) The length or count is invalid.
- PMERR_SPL_QUEUE_ERROR (0x4004) No spooler queue supplied or found.
- PMERR_SPL_PRINT_ABORT (0x4008) The job has already been aborted.
- PMERR_STARTDOC_NOT_ISSUED (0x2104) A request to write spooled output without first issuing a STARTDOC was attempted.
- PMERR_SPL_CANNOT_OPEN_FILE (0x401C) Unable to open the file.
- PMERR_SPL_INV_HSPL (0x4005) The spooler handle is invalid.
- PMERR_SPL_NO_DISK_SPACE (0x4006) There is not enough free disk space.
Remarks
This function writes a buffer of data to the spool file for the print job. The size of the data buffer must not be greater than 64KB. Print jobs that exceed the maximum buffer size must be written by repeatedly calling to this function.
#define INCL_SPL #include <OS2.H> HSPL hspl; /* spooler handle. */ SplQmWrite(hspl, strlen("DATA"), (PVOID)"DATA");
Example Code
#define INCL_SPL /* Or use INCL_PM, */ #include <os2.h> HSPL hspl; /* Spooler handle. */ LONG lCount; /* Length in bytes. */ PVOID pData; /* Buffer of data to be written to the spool file. */ BOOL rc; /* Success indicator. */ rc = SplQmWrite(hspl, lCount, pData);
Related Functions
- Prerequisite Functions
- SplQmOpen
- SplQmStartDoc