CDC::Escape

Syntax

int Escape( int nEscape, int nCount, LPSTR lpInData, LPSTR lpOutData );

Parameters

nEscape

Specifies the escape function to be performed. For a complete list of escape functions, see the chapter on printer escapes in the Windows Software Development Kit documentation.

nCount

Specifies the number of bytes of data pointed to by lpInData.

lpInData

Points to the input data structure required for this escape.

lpOutData

Points to the structure that is to receive output from this escape. The lpOutData parameter is NULL if no data is returned.

Remarks

Allows applications to access facilities of a particular device that are not directly available through GDI. Escape calls made by an application are translated and sent to the device driver.

The nEscape parameter specifies the escape function to be performed. For possible values, see the chapter on printer escapes in the Windows Software Development Kit documentation.

The Microsoft Foundation Class Library provides member functions for some of the most common escape functions.

Return Value

Positive if the function is successful, except for the QUERYESCSUPPORT escape, which only checks for implementation. Or 0 if the escape is not implemented. Or a negative value if there is an error. The following list shows common error values:

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.

See Also

CDC::StartDoc, CDC::StartPage, CDC::EndPage, CDC::SetAbortProc, CDC::AbortDoc, CDC::EndDoc, ::Escape