Jump to content

DevEscape: Difference between revisions

From EDM2
Ak120 (talk | contribs)
first cleanup & duplicate nonsense removal
Line 1: Line 1:
This function allows applications to access facilities of a device not otherwise available through the API. Escapes are, in general, sent to the presentation driver and must be understood by it.
==Syntax==
==Syntax==
This function allows applications to access facilities of a device not otherwise available through the API. Escapes are, in general, sent to the presentation driver and must be understood by it.
  #define INCL_DEV /* Or use INCL_PM, */
  #define INCL_DEV /* Or use INCL_PM, */
  #include <os2.h>
  #include <os2.h>
Line 15: Line 16:
  pbInData, plOutCount, pbOutData);
  pbInData, plOutCount, pbOutData);


==Parameter - hdc==
==Parameter==
hdc (HDC) - input
;hdc (HDC) - input:Device-context handle.
Device-context handle.
;lCode (LONG) - input:Escape code.
 
:If the device context is of type OD_QUEUED with a PM_Q_STD spool file, some escapes are sent to the presentation driver and others are recorded in the spool file (depending on the escape code). If the device context is of type OD_METAFILE, all escapes are metafiled. If the device context is of any type other than OD_QUEUED (with a PM_Q_STD spool file) or OD_METAFILE, all escapes are sent to the presentation driver.
==Parameter - lCode==
:The description for each standard escape specifies which of these categories the escape falls into.
lCode (LONG) - input
:Devices can define additional escape functions using user lCode values, that have the following ranges:
Escape code.
:* 32 768 through 40 959 Not metafiled and not recorded (sent to presentation driver for
 
If the device context is of type OD_QUEUED with a PM_Q_STD spool file, some escapes are sent to the presentation driver and others are recorded in the spool file (depending on the escape code). If the device context is of type OD_METAFILE, all escapes are metafiled. If the device context is of any type other than OD_QUEUED (with a PM_Q_STD spool file) or OD_METAFILE, all escapes are sent to the presentation driver.
 
The description for each standard escape specifies which of these categories the escape falls into.
 
Devices can define additional escape functions using user lCode values, that have the following ranges:
 
* 32 768 through 40 959 Not metafiled and not recorded (sent to presentation driver for
PM_Q_STD)
PM_Q_STD)
* 40 960 through 49 151 Metafiled only (sent to presentation driver for PM_Q_STD)
:* 40 960 through 49 151 Metafiled only (sent to presentation driver for PM_Q_STD)
* 49 152 through 57 343 Metafiled and recorded (not sent to presentation driver) for
:* 49 152 through 57 343 Metafiled and recorded (not sent to presentation driver) for  
PM_Q_STD
PM_Q_STD
* 57 344 through 65 535 Recorded only (not sent to presentation driver for PM_Q_STD).
:* 57 344 through 65 535 Recorded only (not sent to presentation driver for PM_Q_STD).
 
:The following escapes are defined:
The following escapes are defined:
<PRE>
<PRE>
DEVESC_QUERYESCSUPPORT
DEVESC_QUERYESCSUPPORT
Line 48: Line 40:
DEVESC_SETMODE
DEVESC_SETMODE
</PRE>
</PRE>
 
;lInCount (LONG) - input:Input data count.
==Parameter - lInCount==
:Number of bytes of data in the pbInData buffer.
lInCount (LONG) - input
;pbInData (PBYTE) - input:The input data required for this escape.
Input data count.
;plOutCount (PLONG) - in/out:Output data count.
 
:plOutCount is the number of bytes of data in the pbOutData buffer.
Number of bytes of data in the pbInData buffer.
:If data is returned in pbOutData, plOutCount is updated to the number of bytes of data returned.
 
;pbOutData (PBYTE) - output:Output data.
==Parameter - pbInData==
:pbOutData is a buffer that receives the output from this escape. If plOutCount is null, no data is returned.
pbInData (PBYTE) - input
;lResult (LONG) - returns: Implementation error indicator:
 
::DEVESC_ERROR Error
The input data required for this escape.
::DEVESC_NOTIMPLEMENTED Escape not implemented for specified code
 
::DEV_OK OK.
==Parameter - plOutCount==
plOutCount (PLONG) - in/out
Output data count.
 
plOutCount is the number of bytes of data in the pbOutData buffer.
 
If data is returned in pbOutData , plOutCount is updated to the number of bytes of data returned.
 
==Parameter - pbOutData==
pbOutData (PBYTE) - output
Output data.
 
pbOutData is a buffer that receives the output from this escape. If plOutCount is null, no data is returned.
 
==Return Value - lResult==
lResult (LONG) - returns
Implementation error indicator:
 
 
DEVESC_ERROR
Error
 
DEVESC_NOTIMPLEMENTED
Escape not implemented for specified code
 
DEV_OK
OK.
 
==Parameters==
 
===hdc (HDC) - input===
 
    Device-context handle.
 
===lCode (LONG) - input===
 
Escape code.
 
If the device context is of type OD_QUEUED with a PM_Q_STD spool file, some escapes are sent to the presentation driver and others are recorded in the spool file (depending on the escape code). If the device context is of type OD_METAFILE, all escapes are metafiled. If the device context is of any type other than OD_QUEUED (with a PM_Q_STD spool file) or OD_METAFILE, all escapes are sent to the presentation driver.
 
The description for each standard escape specifies which of these categories the escape falls into.
 
Devices can define additional escape functions using user lCode values, that have the following ranges:
 
'''32 768 through 40 959'''
 
Not metafiled and not recorded (sent to presentation driver for PM_Q_STD)
 
'''40 960 through 49 151'''
       
Metafiled only (sent to presentation driver for PM_Q_STD)
 
'''49 152 through 57 343'''
       
Metafiled and recorded (not sent to presentation driver) for PM_Q_STD
 
'''57 344 through 65 535'''
 
Recorded only (not sent to presentation driver for PM_Q_STD). The following escapes are defined:
 
    DEVESC_QUERYESCSUPPORT
    DEVESC_GETSCALINGFACTOR
    DEVESC_STARTDOC
    DEVESC_ENDDOC
    DEVESC_ABORTDOC
    DEVESC_NEWFRAME
    DEVESC_RAWDATA
    DEVESC_QUERYVIOCELLSIZES
    DEVESC_SETMODE
 
===lInCount (LONG) - input===
Input data count.
 
Number of bytes of data in the pbInData buffer.
 
===pbInData (PBYTE) - input===
The input data required for this escape.
 
===plOutCount (PLONG) - in/out===
Output data count.
 
plOutCount is the number of bytes of data in the pbOutData buffer.
 
If data is returned in pbOutData, plOutCount is updated to the number of bytes of data returned.
 
===pbOutData (PBYTE) - output===
Output data.
 
pbOutData is a buffer that receives the output from this escape. If plOutCount is null, no data is returned.
 
===lResult (LONG) - returns===
Implementation error indicator:
 
'''DEVESC_ERROR'''
            Error DEVESC_NOTIMPLEMENTED
            Escape not implemented for specified code
'''DEV_OK'''
            OK.


==Remarks==
==Remarks==
Line 163: Line 57:


===DEVESC_QUERYESCSUPPORT===
===DEVESC_QUERYESCSUPPORT===
Queries whether a particular escape is implemented by the presentation driver. The return value gives the result.
Queries whether a particular escape is implemented by the presentation driver. The return value gives the result.
This escape is not metafiled or recorded.
This escape is not metafiled or recorded.
lInCount Number of bytes pointed to by pbInData .
lInCount Number of bytes pointed to by pbInData.
pbInData The buffer contains an escape code value specifying the escape function to be checked.
pbInData The buffer contains an escape code value specifying the escape function to be checked.
plOutCount Not used; can be set to 0.
plOutCount Not used; can be set to 0.
Line 172: Line 65:


===DEVESC_GETSCALINGFACTOR===
===DEVESC_GETSCALINGFACTOR===
Returns the scaling factors for the x and y axes of a printing device. For each scaling factor, an exponent of two is put in
Returns the scaling factors for the x and y axes of a printing device. For each scaling factor, an exponent of two is put in pbOutData. Thus, the value 3 is used if the scaling factor is 8.
pbOutData . Thus, the value 3 is used if the scaling factor is 8.


Scaling factors are used by devices that cannot support graphics at the same resolution as the device resolution.
Scaling factors are used by devices that cannot support graphics at the same resolution as the device resolution.
Line 181: Line 73:
lInCount Not used; can be set to 0.
lInCount Not used; can be set to 0.
pbInData Not used; can be set to null.
pbInData Not used; can be set to null.
plOutCount The number of bytes of data pointed to by pbOutData . On return, this is updated to the
plOutCount The number of bytes of data pointed to by pbOutData. On return, this is updated to the number of bytes returned.
number of bytes returned.
pbOutData The address of a SFACTORS structure, which on return contains the scaling factors for the x and y axes.
pbOutData The address of a SFACTORS structure, which on return contains the scaling factors for the
x and y axes.


===DEVESC_STARTDOC===
===DEVESC_STARTDOC===
Indicates that a new print job is starting. All subsequent output to the device context is spooled under the same job identifier until a
Indicates that a new print job is starting. All subsequent output to the device context is spooled under the same job identifier until a DEVESC_ENDDOC occurs.
DEVESC_ENDDOC occurs.


GpiAssociate must be issued to associate the presentation space with the device context before issuing this escape.
GpiAssociate must be issued to associate the presentation space with the device context before issuing this escape.


This escape is metafiled but not recorded.
This escape is metafiled but not recorded.
lInCount Number of bytes pointed to by pbInData .
lInCount Number of bytes pointed to by pbInData.
pbInData The buffer contains a null-terminated string, specifying the name of the document.
pbInData The buffer contains a null-terminated string, specifying the name of the document.
plOutCount Not used; can be set to 0.
plOutCount Not used; can be set to 0.
Line 207: Line 96:


===DEVESC_ABORTDOC===
===DEVESC_ABORTDOC===
Aborts the current job, erasing everything the application has written to the device since the last DEVESC_STARTDOC, including
Aborts the current job, erasing everything the application has written to the device since the last DEVESC_STARTDOC, including the DEVESC_STARTDOC.
the DEVESC_STARTDOC.
This escape is metafiled but not recorded.
This escape is metafiled but not recorded.
lInCount Not used; can be set to 0
lInCount Not used; can be set to 0
Line 225: Line 113:
DEVESC_RAWDATA
DEVESC_RAWDATA


Allows an application to send data directly to a presentation driver. For example, in the case of a printer driver, this could be a
Allows an application to send data directly to a presentation driver. For example, in the case of a printer driver, this could be a printer data stream.
printer data stream.
If DEVESC_RAWDATA is mixed with other data (such as GPI data) being sent to the same page of a device context, the results are unpredictable and depend upon the action taken by the presentation driver. For example, a presentation driver might ignore GPI data if DEVESC_RAWDATA is mixed with it on the same page. In general, DEVESC_RAWDATA should be sent either to a separate page (using the DEVESC_NEWFRAME escape to obtain a new page) or to a separate document (using the DEVESC_STARTDOC and DEVESC_ENDDOC escapes to create a new document).
If DEVESC_RAWDATA is mixed with other data (such as GPI data) being sent to the same page of a device context, the results
are unpredictable and depend upon the action taken by the presentation driver. For example, a presentation driver might ignore
GPI data if DEVESC_RAWDATA is mixed with it on the same page. In general, DEVESC_RAWDATA should be sent either to a
separate page (using the DEVESC_NEWFRAME escape to obtain a new page) or to a separate document (using the
DEVESC_STARTDOC and DEVESC_ENDDOC escapes to create a new document).
This escape is metafiled and recorded.
This escape is metafiled and recorded.
lInCount Number of bytes pointed to by pbInData
lInCount Number of bytes pointed to by pbInData pbInData Pointer to the raw data plOutCount Not used; can be set to 0 pbOutData Not used; can be set to null.
pbInData Pointer to the raw data
plOutCount Not used; can be set to 0
pbOutData Not used; can be set to null.


===DEVESC_QUERYVIOCELLSIZES===
===DEVESC_QUERYVIOCELLSIZES===
Line 245: Line 125:
lInCount Not used; can be set to 0
lInCount Not used; can be set to 0
pbInData Not used; can be set to null.
pbInData Not used; can be set to null.
plOutCount The number of bytes of data pointed to by pbOutData . It must be an even multiple of the
plOutCount The number of bytes of data pointed to by pbOutData. It must be an even multiple of the size in bytes of the LONG data type. On return, this is updated to the number of bytes
size in bytes of the LONG data type. On return, this is updated to the number of bytes
returned.
returned.
pbOutData The address of a buffer, which on return contains a VIOSIZECOUNT structure, immediately
pbOutData The address of a buffer, which on return contains a VIOSIZECOUNT structure, immediately followed by count copies of a VIOFONTCELLSIZE structure.
followed by count copies of a VIOFONTCELLSIZE structure.
If plOutCount is less than the size of a LONG data type, plOutCount is updated to zero,
If plOutCount is less than the size of a LONG data type, plOutCount is updated to zero,
and nothing is returned in the buffer pointed to by pbOutData .
and nothing is returned in the buffer pointed to by pbOutData.
If plOutCount is equal to the size of a LONG data type, pbOutData returns the number of
If plOutCount is equal to the size of a LONG data type, pbOutData returns the number of
VIO cell sizes that can be returned by this escape. The buffer pointed to by pbOutData is
VIO cell sizes that can be returned by this escape. The buffer pointed to by pbOutData is
Line 257: Line 135:
If plOutCount is greater than the size of a LONG data type, pbOutData returns the VIO cell
If plOutCount is greater than the size of a LONG data type, pbOutData returns the VIO cell
sizes that are supported. The buffer pointed to by pbOutData is updated so that:
sizes that are supported. The buffer pointed to by pbOutData is updated so that:
maxcount is the number of VIO cell sizes that can be returned
*maxcount is the number of VIO cell sizes that can be returned
count is the number of VIO cell sizes returned (may be zero if plOutCount is
*count is the number of VIO cell sizes returned (may be zero if plOutCount is equal to twice the size of a LONG data type)
equal to twice the size of a LONG data type)
*count copies of a VIOFONTCELLSIZE structure are returned.
count copies of a VIOFONTCELLSIZE structure are returned.


===DEVESC_SETMODE===
===DEVESC_SETMODE===
Sets the printer into a particular mode. It is optional for printer drivers to support this escape, but those that do support it need to be
Sets the printer into a particular mode. It is optional for printer drivers to support this escape, but those that do support it need to be aware of the code page of any built-in fonts. For example, if only code page 437 is built in, it is used if 437 is requested by
aware of the code page of any built-in fonts. For example, if only code page 437 is built in, it is used if 437 is requested by
DEVESC_SETMODE; however, if code page 865 is requested, a suitable code page/font could be downloaded.
DEVESC_SETMODE; however, if code page 865 is requested, a suitable code page/font could be downloaded.
This escape is metafiled and recorded.
This escape is metafiled and recorded.
Line 271: Line 147:
plOutCount Not used; can be set to 0
plOutCount Not used; can be set to 0
pbOutData Not used; can be set to null.
pbOutData Not used; can be set to null.


==Errors==
==Errors==
Line 300: Line 175:
==Example Code==
==Example Code==
This example uses DevEscape to access facilities of a device that would otherwise be unavailable through the normal Device API set. Here, a new page in a print job is started.
This example uses DevEscape to access facilities of a device that would otherwise be unavailable through the normal Device API set. Here, a new page in a print job is started.
<PRE>
<PRE>
#define INCL_DEV        /* Device Function definitions  */
#define INCL_DEV        /* Device Function definitions  */
Line 319: Line 193:


lResult = DevEscape(hdc, DEVESC_NEWFRAME, 0L, NULL, &plOutCount,pbOutData);
lResult = DevEscape(hdc, DEVESC_NEWFRAME, 0L, NULL, &plOutCount,pbOutData);
</PRE>
</PRE>


[[Category:The OS/2 API Project]]
[[Category:Dev]]

Revision as of 05:05, 4 January 2017

This function allows applications to access facilities of a device not otherwise available through the API. Escapes are, in general, sent to the presentation driver and must be understood by it.

Syntax

#define INCL_DEV /* Or use INCL_PM, */
#include <os2.h>

HDC hdc; /* Device-context handle. */
LONG lCode; /* Escape code. */
LONG lInCount; /* Input data count. */
PBYTE pbInData; /* The input data required for this escape. */
PLONG plOutCount; /* Output data count. */
PBYTE pbOutData; /* Output data. */
LONG lResult; /* Implementation error indicator: */

lResult = DevEscape(hdc, lCode, lInCount,
pbInData, plOutCount, pbOutData);

Parameter

hdc (HDC) - input
Device-context handle.
lCode (LONG) - input
Escape code.
If the device context is of type OD_QUEUED with a PM_Q_STD spool file, some escapes are sent to the presentation driver and others are recorded in the spool file (depending on the escape code). If the device context is of type OD_METAFILE, all escapes are metafiled. If the device context is of any type other than OD_QUEUED (with a PM_Q_STD spool file) or OD_METAFILE, all escapes are sent to the presentation driver.
The description for each standard escape specifies which of these categories the escape falls into.
Devices can define additional escape functions using user lCode values, that have the following ranges:
  • 32 768 through 40 959 Not metafiled and not recorded (sent to presentation driver for

PM_Q_STD)

  • 40 960 through 49 151 Metafiled only (sent to presentation driver for PM_Q_STD)
  • 49 152 through 57 343 Metafiled and recorded (not sent to presentation driver) for

PM_Q_STD

  • 57 344 through 65 535 Recorded only (not sent to presentation driver for PM_Q_STD).
The following escapes are defined:
DEVESC_QUERYESCSUPPORT
DEVESC_GETSCALINGFACTOR
DEVESC_STARTDOC
DEVESC_ENDDOC
DEVESC_ABORTDOC
DEVESC_NEWFRAME
DEVESC_RAWDATA
DEVESC_QUERYVIOCELLSIZES
DEVESC_SETMODE
lInCount (LONG) - input
Input data count.
Number of bytes of data in the pbInData buffer.
pbInData (PBYTE) - input
The input data required for this escape.
plOutCount (PLONG) - in/out
Output data count.
plOutCount is the number of bytes of data in the pbOutData buffer.
If data is returned in pbOutData, plOutCount is updated to the number of bytes of data returned.
pbOutData (PBYTE) - output
Output data.
pbOutData is a buffer that receives the output from this escape. If plOutCount is null, no data is returned.
lResult (LONG) - returns
Implementation error indicator:
DEVESC_ERROR Error
DEVESC_NOTIMPLEMENTED Escape not implemented for specified code
DEV_OK OK.

Remarks

The data fields for standard escapes are:

DEVESC_QUERYESCSUPPORT

Queries whether a particular escape is implemented by the presentation driver. The return value gives the result. This escape is not metafiled or recorded. lInCount Number of bytes pointed to by pbInData. pbInData The buffer contains an escape code value specifying the escape function to be checked. plOutCount Not used; can be set to 0. pbOutData Not used; can be set to null.

DEVESC_GETSCALINGFACTOR

Returns the scaling factors for the x and y axes of a printing device. For each scaling factor, an exponent of two is put in pbOutData. Thus, the value 3 is used if the scaling factor is 8.

Scaling factors are used by devices that cannot support graphics at the same resolution as the device resolution.

This escape is not metafiled or recorded.

lInCount Not used; can be set to 0. pbInData Not used; can be set to null. plOutCount The number of bytes of data pointed to by pbOutData. On return, this is updated to the number of bytes returned. pbOutData The address of a SFACTORS structure, which on return contains the scaling factors for the x and y axes.

DEVESC_STARTDOC

Indicates that a new print job is starting. All subsequent output to the device context is spooled under the same job identifier until a DEVESC_ENDDOC occurs.

GpiAssociate must be issued to associate the presentation space with the device context before issuing this escape.

This escape is metafiled but not recorded. lInCount Number of bytes pointed to by pbInData. pbInData The buffer contains a null-terminated string, specifying the name of the document. plOutCount Not used; can be set to 0. pbOutData Not used; can be set to null.

DEVESC_ENDDOC

Ends a print job started by DEVESC_STARTDOC. This escape is metafiled but not recorded. lInCount Not used; can be set to 0. pbInData Not used; can be set to null. plOutCount Set equal to 2. pbOutData The buffer contains a USHORT specifying the job identifier if a spooler print job is created.

DEVESC_ABORTDOC

Aborts the current job, erasing everything the application has written to the device since the last DEVESC_STARTDOC, including the DEVESC_STARTDOC. This escape is metafiled but not recorded. lInCount Not used; can be set to 0 pbInData Not used; can be set to null plOutCount Not used; can be set to 0 pbOutData Not used; can be set to null.

DEVESC_NEWFRAME

Signals when an application has finished writing to a page and wants to start a new page. It is similar to GpiErase processing for a screen device context, and causes a reset of the attributes. This escape is used with a printer device to advance to a new page. This escape is metafiled and recorded. lInCount Not used; can be set to 0 pbInData Not used; can be set to null plOutCount Not used; can be set to 0 pbOutData Not used; can be set to null. DEVESC_RAWDATA

Allows an application to send data directly to a presentation driver. For example, in the case of a printer driver, this could be a printer data stream. If DEVESC_RAWDATA is mixed with other data (such as GPI data) being sent to the same page of a device context, the results are unpredictable and depend upon the action taken by the presentation driver. For example, a presentation driver might ignore GPI data if DEVESC_RAWDATA is mixed with it on the same page. In general, DEVESC_RAWDATA should be sent either to a separate page (using the DEVESC_NEWFRAME escape to obtain a new page) or to a separate document (using the DEVESC_STARTDOC and DEVESC_ENDDOC escapes to create a new document). This escape is metafiled and recorded. lInCount Number of bytes pointed to by pbInData pbInData Pointer to the raw data plOutCount Not used; can be set to 0 pbOutData Not used; can be set to null.

DEVESC_QUERYVIOCELLSIZES

Returns the VIO cell sizes supported by the presentation driver.

This escape is not metafiled or recorded.

lInCount Not used; can be set to 0 pbInData Not used; can be set to null. plOutCount The number of bytes of data pointed to by pbOutData. It must be an even multiple of the size in bytes of the LONG data type. On return, this is updated to the number of bytes returned. pbOutData The address of a buffer, which on return contains a VIOSIZECOUNT structure, immediately followed by count copies of a VIOFONTCELLSIZE structure. If plOutCount is less than the size of a LONG data type, plOutCount is updated to zero, and nothing is returned in the buffer pointed to by pbOutData. If plOutCount is equal to the size of a LONG data type, pbOutData returns the number of VIO cell sizes that can be returned by this escape. The buffer pointed to by pbOutData is updated so that maxcount is the number of VIO cell sizes that can be returned. If plOutCount is greater than the size of a LONG data type, pbOutData returns the VIO cell sizes that are supported. The buffer pointed to by pbOutData is updated so that:

  • maxcount is the number of VIO cell sizes that can be returned
  • count is the number of VIO cell sizes returned (may be zero if plOutCount is equal to twice the size of a LONG data type)
  • count copies of a VIOFONTCELLSIZE structure are returned.

DEVESC_SETMODE

Sets the printer into a particular mode. It is optional for printer drivers to support this escape, but those that do support it need to be aware of the code page of any built-in fonts. For example, if only code page 437 is built in, it is used if 437 is requested by DEVESC_SETMODE; however, if code page 865 is requested, a suitable code page/font could be downloaded. This escape is metafiled and recorded. lInCount Number of bytes pointed to by pbInData pbInData Buffer contains an ESCSETMODE structure plOutCount Not used; can be set to 0 pbOutData Not used; can be set to null.

Errors

Possible returns from WinGetLastError PMERR_INV_ESC_CODE (0x206D) An invalid escape code was used in a call to DevEscape. PMERR_INV_HDC (0x207C) An invalid device-context handle or (micro presentation space) presentation-space handle was specified. PMERR_INV_LENGTH_OR_COUNT (0x2092) An invalid length or count parameter was specified. PMERR_ESC_CODE_NOT_SUPPORTED (0x202B) The code specified with DevEscape is not supported by the target device driver. PMERR_INV_ESCAPE_DATA (0x206E) An invalid data parameter was specified with DevEscape.

Related Functions

Prerequisite Functions

  • DevOpenDC

Related Functions

  • GpiAssociate (for DEVESC_STARTDOC)
  • GpiErase (for DEVESC_NEWFRAME)

Graphic Elements and Orders

DevEscape functions generate orders only when metafiling. Order: GEESCP

Example Code

This example uses DevEscape to access facilities of a device that would otherwise be unavailable through the normal Device API set. Here, a new page in a print job is started.

#define INCL_DEV        /* Device Function definitions  */
#include <os2.h>

LONG  lResult;          /* Error code or not implemented
                           warning code                         */
HDC   hdc;              /* Device-context handle                */
LONG  plOutCount;       /* length of output buffer(input),
                           number of bytes returned(output)     */
PBYTE pbOutData;        /* output buffer                        */

/* for the NEWFRAME, input and output buffers are not used,
   so set the buffer lengths to zero(0) and set the buffers to
   NULL */
plOutCount = 0;
pbOutData = NULL;

lResult = DevEscape(hdc, DEVESC_NEWFRAME, 0L, NULL, &plOutCount,pbOutData);