Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
GpiRemoveDynamics (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPISEGMENTS
BOOL GpiRemoveDynamics(hps, idFirstSegment, idLastSegment)
HPS hps; /* presentation-space handle */
LONG idFirstSegment; /* first segment identifier */
LONG idLastSegment; /* last segment identifier */
The GpiRemoveDynamics function removes from the display any images drawn
using dynamic segments. The function removes the image for any dynamic
segment that is in the current picture chain and whose segment identifier is
in the range specified by the idFirstSegment and idLastSegment parameters.
The function removes only the image drawn using the dynamic segment and by
the dynamic segment's segment calls.
The GpiRemoveDynamics function checks for the segments specified by
idFirstSegment and idLastSegment. If they do not exist, or are not in the
chain, or idLastSegment is less than idFirstSegment, the function returns
without removing segments and without an error value.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
idFirstSegment Specifies the name of the first segment in the section. It
must be greater than zero.
idLastSegment Specifies the last segment in the section. It must be
greater than zero.
Return Value
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
Errors
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
PMERR_AREA_INCOMPLETE
PMERR_INV_FOR_THIS_DC_TYPE
PMERR_INV_HPS
PMERR_INV_MICROPS_FUNCTION
PMERR_INV_SEG_NAME
PMERR_PATH_INCOMPLETE
PMERR_PS_BUSY
PMERR_SEG_NOT_CHAINED
Comments
An application should remove dynamic segments before associating a new
device context with the presentation space.
Example
This example uses the GpiRemoveDynamics function to remove the image drawn
by the dynamic segment whose segment identifier is 4. It then edits the
segment and redraws it, using the GpiDrawDynamics function.
POINTL ptl = {30, 40};
/* Remove the image for dynamic segment #4. */
GpiRemoveDynamics(hps, 4L, 4L);
/* Edit the segment. */
GpiSetDrawingMode(DM_RETAIN);
GpiOpenSegment(hps, 4L);
GpiSetElementPointer(hps, 1L);
GpiMove(hps, &ptl);
GpiCloseSegment(hps);
GpiDrawDynamics(hps); /* redraws the edited segment */
See Also
GpiCloseSegment, GpiDrawDynamics, WinGetLastError
♦