Jump to content

GreRestoreXform

From EDM2
Revision as of 10:43, 5 April 2025 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GreRestoreXform is called during RestoreDC and CloseDC to allow simulations to restore their local data structures. When a DC is closed, GreRestoreXform is called with a count of 0 to free its local data.

Simulation support
This function is simulated by a handling routine in the graphics engine.

Syntax

GreRestoreXform(hdc, cSave, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
cSave (LONG) - input
DC save level.
Indicates the saved DC state, which the handling routine uses to restore the transform. When cSave is passed as -1, the handling routine resets the transform to its initial state (-1 is passed to this routine from GreResetDC and is the only valid negative value). A value of 0 indicates that the transform is reset to its initial state. Other positive values identify which saved level is restored. See RestoreDCState.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreRestoreXform.

Return Code

fSuccess (BOOL) - returns
Return codes.
This function returns BOOLEAN (fSuccess).
  • TRUE Successful
  • FALSE Error
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
  • PMERR_HDC_BUSY
  • PMERR_INV_HDC
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Declaration

#define INCL_GRE_XFORMS
#include <os2.h>

HDC      hdc;        /*  Device context handle. */
LONG     cSave;      /*  DC save level. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreRestoreXform. */
BOOL     fSuccess;   /*  Return codes. */

fSuccess = GreRestoreXform(hdc, cSave, pInstance, lFunction);