Jump to content

SplQmEndDoc

From EDM2
Revision as of 23:21, 8 June 2021 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

SplQmEndDoc ends a print job, and returns ulJob, a unique number to identify the job. This function corresponds to the DevEscape (DEVESC_ENDDOC) call.

Syntax

ulJob = SplQmEndDoc(hspl);

Parameters

hspl (HSPL) - input
Spooler handle.

Return Code

ulJob (ULONG) - returns
Job identifier.
  • Nonzero - Jobid (1 through 65,535)
  • SPL_ERROR - Error
Error Conditions
Possible returns from WinGetLastError
  • PMERR_SPL_QUEUE_ERROR (0x4004) No spooler queue supplied or found.
  • PMERR_SPL_NO_DATA (0x400D) No data supplied or found.
  • PMERR_SPL_INV_HSPL (0x4005) The spooler handle is invalid.

Remarks

This function is used to end a print job and return the job id. The print-job identifier is displayed to the user by the spooler while this job is on the queue, and while it is being printed.

Example Code

#define INCL_SPL
#include <OS2.H>

HSPL hspl;  /* spooler handle. */
ULONG jobid;
CHAR szMsg[100];
HWND hwndClient;

jobid = SplQmEndDoc(hspl);

sprintf(szMsg, "ending job %d",jobid);
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 */

Related Functions

Prerequisite Functions
SplQmOpen
SplQmStartDoc
Related Functions
DevEscape