OpenJob

  HANDLE FAR PASCAL OpenJob(lpOutput, lpTitle, hdc)    
  LPSTR lpOutput;    
  LPSTR lpTitle;    
  HDC hdc;    

The OpenJob function creates a print job and returns a handle identifying the job. A driver uses the handle in subsequent functions to write output to the print job as well as control the job.

Parameters

lpOutput

Points to a null-terminated string specifying the port or file to receive the output. A driver typically supplies the same filename as pointed to by the lpOutputFile parameter when GDI calls the driver's Enable function.

lpTitle

Points to a null-terminated string specifying the title of the document to print. This parameter must be supplied by the application when it calls the STARTDOC escape. This title appears in the Print Manager display.

hdc

Identifies the application's device context. This parameter must be supplied by the application when it calls the STARTDOC escape.

Return Value

The return value is a handle identifying the print job if the function is successful. Otherwise, it is one of the following error values.

Value Meaning

SP_ERROR (-1) A general error condition or general error in banding occurred.
SP_APPABORT (-2) The job was stopped because the application's callback function returned FALSE (0).
SP_USERABORT (-3) The user stopped the print job by choosing the Delete button from Print Manager.
SP_OUTOFDISK (-4) A lack of disk space caused the job to stop. There is not enough disk space to create or extend the Print Manager temporary file.
SP_OUTOFMEMORY (-5) A lack of memory caused the job to stop.

See Also

CloseJob, Enable, STARTDOC