ABORTDOC

Syntax

short Escape(hDC, ABORTDOC,NULL, NULL, NULL)

This escape terminates the current job, erasing everything the application has written to the device since the last ENDDOC escape.

The ABORTDOC escape should be used to terminate:

Printing operations that do not specify an abort function using the SETABORTPROC escape

Printing operations that have not yet reached their first NEWFRAME or NEXTBAND escape call

Parameter Type/Description  

hDC HDC Identifies the device context.  

Return Value

The return value specifies the outcome of the escape. It is positive if the escape is successful. Otherwise, it is negative.

Comments

If an application encounters a printing error or a canceled print operation, it must not attempt to terminate the operation by using the Escape function with either the ENDDOC or ABORTDOC escape. GDI automatically terminates the operation before returning the error value.

If the application displays a dialog box to allow the user to cancel the print operation, it must send the ABORTDOC escape before destroying the dialog box.

The application must send the ABORTDOC escape before freeing the procedure-instance address of the abort function, if any.