This documentation is archived and is not being maintained.


This member function is practically obsolete for Win32 programming.

virtual int Escape(
   int nEscape,
   int nCount,
   LPCSTR lpszInData,
   LPVOID lpOutData 
int Escape(
   int nEscape,
   int nInputSize,
   LPCSTR lpszInputData,
   int nOutputSize,
   LPSTR lpszOutputData 



Specifies the escape function to be performed.

For a complete list of escape functions, see Escape in the Platform SDK.


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


Points to the input data structure required for this escape.


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


Specifies the number of bytes of data pointed to by the lpszInputData parameter.


Points to the input structure required for the specified escape.


Specifies the number of bytes of data pointed to by the lpszOutputData parameter.


Points to the structure that receives output from this escape. This parameter should be NULL if no data is returned.

A positive value is returned if the function is successful, except for the QUERYESCSUPPORT escape, which only checks for implementation. Zero is returned if the escape is not implemented. A negative value is returned if an error occurred. The following are common error values:

  • 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 ended the job through the Print Manager.

Of the original printer escapes, only QUERYESCSUPPORT is supported for Win32 applications. All other printer escapes are obsolete and are supported only for compatibility with 16-bit applications.

For Win32 programming, CDC now provides six member functions that supersede their corresponding printer escapes:

In addition, CDC::GetDeviceCaps supports Win32 indexes that supersede other printer escapes. See GetDeviceCaps in the Platform SDK for more information.

This member function allows applications to access facilities of a particular device that are not directly available through GDI.

Use the first version if your application uses predefined escape values. Use the second version if your application defines private escape values. See ExtEscape in the Platform SDK for more information about the second version.