OpenPrintProcessor function

A print processor's OpenPrintProcessor function prepares the print processor for printing a job and returns a handle.

Syntax

HANDLE OpenPrintProcessor(
  LPWSTR                  pPrinterName,
  PPRINTPROCESSOROPENDATA pPrintProcessorOpenData
);

Parameters

pPrinterName

Caller-supplied pointer to the name of the printer for which the print processor is being opened.

pPrintProcessorOpenData

Caller-supplied pointer to a PRINTPROCESSOROPENDATA structure.

Return Value

If the operation succeeds, the function should return a handle that can be used as an input argument for subsequent calls to PrintDocumentOnPrintProcessor, ControlPrintProcessor, and ClosePrintProcessor. If the operation fails, the function should call SetLastError to set an error code, and then return NULL.

Remarks

Print processors are required to export an OpenPrintProcessor function. The spooler calls the function when a print job is available. The function should perform initialization operations that are required before a job can be processed, based on the job's data type.

The function must return a handle. Typically, the handle is a pointer to an internal structure. The structure must contain a pointer to the printer's name and a pointer to the printer's DEVMODEW structure, both of which are received in the PRINTPROCESSOROPENDATA structure. These two pointers are required by the print processor's PrintDocumentOnPrintProcessor function, and this latter function receives the handle as input when the spooler calls it.

Requirements

   
Target Platform Desktop
Header winsplp.h (include Winsplp.h)
Library Nwprint.lib

See Also

ClosePrintProcessor

ControlPrintProcessor

PRINTPROCESSOROPENDATA

PrintDocumentOnPrintProcessor