Jump to content

DEVESC_GETCP

From EDM2

GreEscape DEVESC_GETCP gets a hardcopy data stream that would set the specified code page in the hardcopy device. Note: This escape code is used only by hardcopy drivers with built-in fonts.

Simulation support

This function is mandatory for hardcopy drivers, but may simply return a DEVESC_NOTIMPLEMENTED code. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

 GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);

Parameters

hdc (HDC) - input
Device context handle.
lEscape (LONG) - input
DEVESC_GETCP escape code.
cInCount (LONG) - input
The handling routine ignores this parameter.
pInData (PBYTE) - input
The handling routine ignores this parameter.
pcOutCount (PLONG) - input
Pointer to the number of bytes addressed by pOutData.
The handling routine should update this value to show the number of bytes returned in the buffer.
pOutData (PLONG) - input
Pointer to the buffer in which the handling routine returns the required data.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreEscape.

Returns

rc (LONG) - returns
Return Code.
The handling routine returns:
DEV_OK
Successful
DEVESC_NOTIMPLEMENTED
Escape not implemented for specified code
DEVESC_ERROR
Error

Remarks

The data stream should provide for options, such as "draft" and "NLQ," as defined in the OS2_PM_DRV_DEVMODE dialog. The handling routine in the presentation driver responds by writing the data stream in the buffer addressed by pOutData and the count of bytes into the LONG value addressed by pcOutCount.

This escape code is not metafiled or recorded.

Sample Source Code

Declaration:

#define INCL_GRE_DEVICE
#include <os2.h>

HDC       hdc;           /* Device context handle. */
LONG      lEscape;       /* DEVESC_GETCP escape code. */
LONG      cInCount;      /* The handling routine ignores this parameter. */
PBYTE     pInData;       /* The handling routine ignores this parameter. */
PLONG     pcOutCount;    /* Pointer to the number of bytes addressed by pOutData. */
PLONG     pOutData;      /* Pointer to the buffer in which the handling routine returns the required data. */
PVOID     pInstance;     /* Pointer to instance data. */
ULONG     lFunction;     /* High-order WORD=flags; low-order WORD=NGreEscape. */
LONG      rc;            /* Return Code. */

rc = GreEscape(hdc, lEscape, cInCount, pInData,
        pcOutCount, pOutData, pInstance, lFunction);