Jump to content

SplQmStartDoc

From EDM2
Revision as of 20:26, 2 July 2023 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

SplQmStartDoc starts a print job. It corresponds to the DevEscape (DEVESC_STARTDOC) call.

Syntax

rc = SplQmStartDoc(hspl, pszDocName);

Parameters

hspl (HSPL) - input
Spooler handle.
pszDocName (PSZ) - input
Document name.
This is part of the job description that is displayed to the end user by the spooler.

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_SPL_QUEUE_ERROR (0x4004) - No spooler queue supplied or found.
  • PMERR_ENDDOC_NOT_ISSUED (0x210B) - A request to close the spooled output without first issuing an ENDDOC was attempted.
  • PMERR_SPL_INV_HSPL (0x4005) - The spooler handle is invalid.

Remarks

This function indicates the start of a print job. It allows the application to specify a document name to be associated with the print job.

Multiple print jobs can be generated, within a single queue manager open, by bracketing each job with SplQmStartDoc and SplQmEndDoc.

Example Code

#define INCL_SPL
#include <OS2.H>

HSPL hspl;  /* spooler handle. */
CHAR szDocName[] = "Test Job";
CHAR szMsg[100];
HWND hwndClient;

sprintf(szMsg, "Starting job named: %s",szDocName);
WinMessageBox(HWND_DESKTOP,
    hwndClient,                /* client-window handle */
    szMsg,                     /* body of the message  */
    "Printing Information",    /* title of the message */
    0,                         /* message box id       */
    MB_NOICON | MB_OK);  /* icon and button flags */

SplQmStartDoc(hspl,szDocName);

Related Functions

Prerequisite Functions
SplQmOpen
Related Functions
DevEscape