Callback Function

The callback function must use the Pascal calling convention, must be exported with __export, and must be declared FAR.

short FAR PASCAL __export AbortFunc( HDC hPr, short code );

The name AbortFunc is a placeholder for the application-supplied function name. The actual name must be exported as described in the “Remarks” section above.

Parameter Description

hPr Identifies the device context.
code Specifies whether an error has occurred. It is 0 if no error has occurred. It is SP_OUTOFDISK if Print Manager is currently out of disk space and more disk space will become available if the application waits. If code is SP_OUTOFDISK, the application does not have to abort the print job. If it does not, it must yield to Print Manager by calling the PeekMessage or GetMessage function.

Return Value

The return value of the abort-handler function is nonzero if the print job is to continue, and 0 if it is canceled.

Return Value

Specifies the outcome of the SetAbortProc function. Some of the following values are more probable than others, but all are possible.

Value Meaning

SP_ERROR General error.
SP_OUTOFDISK Not enough disk space is currently available for spooling, and no more space will become available.
SP_OUTOFMEMORY Not enough memory is available for spooling.
SP_USERABORT User terminated the job through the Print Manager.