SplQmWrite

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

A parameter to the function contained invalid data.
 * PMERR_INVALID_PARM (0x1303)

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_BASE_ERROR (0x2006)

The length or count is invalid.
 * PMERR_SPL_INV_LENGTH_OR_COUNT (0x401A)

No spooler queue supplied or found.
 * PMERR_SPL_QUEUE_ERROR (0x4004)

The job has already been aborted.
 * PMERR_SPL_PRINT_ABORT (0x4008)

A request to write spooled output without first issuing a STARTDOC was attempted.
 * PMERR_STARTDOC_NOT_ISSUED (0x2104)

Unable to open the file.
 * PMERR_SPL_CANNOT_OPEN_FILE (0x401C)

The spooler handle is invalid.
 * PMERR_SPL_INV_HSPL (0x4005)

There is not enough free disk space.
 * PMERR_SPL_NO_DISK_SPACE (0x4006)

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. 
 * 1) define INCL_SPL
 * 2) include 

HSPL hspl; /* spooler handle. */

SplQmWrite(hspl,          strlen("DATA"),           (PVOID)"DATA"); 

Example Code

 * 1) define INCL_SPL /* Or use INCL_PM, */
 * 2) include 

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