gpi12.hlp (Table of Contents; Topic list)
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.
GpiDeleteSegment (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPISEGMENTS
 
BOOL GpiDeleteSegment(hps, idSegment)
HPS hps;           /* presentation-space handle       */
LONG idSegment;    /* identifier of segment to delete */
 
The GpiDeleteSegment function deletes the segment specified by idSegment. If
the segment is open, the function automatically closes the segment before
deleting it. If the segment is in the picture chain, the function removes it
from the chain.
 
This function deletes only segments created using the GpiOpenSegment
function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
idSegment  Specifies the segment to delete; it must be greater than zero.
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_HPS
     PMERR_INV_MICROPS_FUNCTION
     PMERR_INV_SEG_NAME
     PMERR_PS_BUSY
 
Example
 
This example uses the GpiDeleteSegment function to delete segment 4:
 
POINTL ptlStart = { 0, 0 };
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
 
GpiOpenSegment(hps, 4L);               /* open the segment           */
GpiMove(hps, &ptlStart);               /* move to start point (0, 0) */
GpiPolyLine(hps, 3L, ptlTriangle);     /* draw triangle              */
GpiCloseSegment(hps);                  /* close the segment          */
    .
    .
    .
GpiDeleteSegment(hps, 4L);             /* delete segment #4          */
 
See Also
 
GpiCloseSegment, GpiDeleteSegments, GpiOpenSegment, GpiQuerySegmentNames,
WinGetLastError