AbortDoc

3.1

  int AbortDoc(hdc)    
  HDC hdc; /* handle of device context */

The AbortDoc function terminates the current print job and erases everything drawn since the last call to the StartDoc function. This function replaces the ABORTDOC printer escape for Windows version 3.1.

Parameters

hdc

Identifies the device context for the print job.

Return Value

The return value is greater than or equal to zero if the function is successful. Otherwise, it is less than zero.

Comments

Applications should call the AbortDoc function to terminate a print job because of an error or if the user chooses to cancel the job. To end a successful print job, an application should use the EndDoc function.

If Print Manager was used to start the print job, calling the AbortDoc function erases the entire spool job—the printer receives nothing. If Print Manager was not used to start the print job, the data may have been sent to the printer before AbortDoc was called. In this case, the printer driver would have reset the printer (when possible) and closed the print job.

See Also

EndDoc, SetAbortProc, StartDoc