Jump to content

GreRestorePath: Difference between revisions

From EDM2
Created page with "GreRestorePath is called during RestoreDC and CloseDC to allow the path handling routines to restore their local data structures. When a DC is closed, GreRestorePath is called..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreRestorePath is called during RestoreDC and CloseDC to allow the path handling routines to restore their local data structures. When a DC is closed, GreRestorePath is called with a count of 0 to free its local data.  
GreRestorePath is called during RestoreDC and CloseDC to allow the path handling routines to restore their local data structures. When a DC is closed, GreRestorePath is called with a count of 0 to free its local data.


This function can be hooked by the presentation driver.  
This function can be hooked by the presentation driver.


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


==Syntax==
==Syntax==
  GreRestorePath(hdc, cSave, pInstance, lFunction);
  GreRestorePath(hdc, cSave, pInstance, lFunction)


==Parameters==
==Parameters==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;cSave (LONG) - input:DC save level.
 
:Indicates the saved DC state, which the handling routine uses to restore the path. When cSave is passed as 1, the handling routine resets the path 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 path is restored to its initial state. Other positive values identify which saved level is restored. See RestoreDCState.
;cSave (LONG) - input  
;pInstance (PVOID) - input:Pointer to instance data.
:DC save level.  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreRestorePath.
 
:Indicates the saved DC state, which the handling routine uses to restore the path. When cSave is passed as 1, the handling routine resets the path 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 path is restored 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=NGreRestorePath.  


==Return Code==
==Return Code==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:This function returns BOOLEAN (fSuccess).
 
:*TRUE Successful
:This function returns BOOLEAN (fSuccess).  
:*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:
:*TRUE Successful  
:*PMERR_HDC_BUSY
:*FALSE Error  
:*PMERR_INV_HDC
 
:Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
: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.  


==Remarks==
==Remarks==
This function is required to ensure that memory is freed.  
This function is required to ensure that memory is freed.
 
==Sample Code==
<PRE>
#define INCL_GRE_PATHS
#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=NGreRestorePath. */
BOOL    fSuccess;  /*  Return codes. */
 
fSuccess = GreRestorePath(hdc, cSave, pInstance, lFunction);
 
</PRE>


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 07:44, 5 March 2020

GreRestorePath is called during RestoreDC and CloseDC to allow the path handling routines to restore their local data structures. When a DC is closed, GreRestorePath is called with a count of 0 to free its local data.

This function can be hooked by the presentation driver.

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

Syntax

GreRestorePath(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 path. When cSave is passed as 1, the handling routine resets the path 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 path is restored 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=NGreRestorePath.

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.

Remarks

This function is required to ensure that memory is freed.