GpiEndElement
Appearance
This function terminates an element started by GpiBeginElement.
Syntax
GpiEndElement(hps)
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Value
- rc (BOOL) - returns
- Success indicator.
- TRUE - Successful completion
- FALSE - Error occurred.
Errors
Possible returns from WinGetLastError:
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
- PMERR_NOT_IN_ELEMENT (0x20DF)
- An attempt was made to end an element using GpiEndElement or during segment drawing while not in an element bracket.
Example Code
This example uses the GpiEndElement function to end an element bracket.
#define INCL_GPISEGEDITING /* GPI Segment Edit functions */
#include <os2.h>
HPS hps; /* presentation space handle */
POINTL ptlStart = { 0, 0 }; /* first vertex */
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices */
.
.
.
/* begin the element bracket */
GpiBeginElement(hps, 1L, "Triangle");
GpiMove(hps, &ptlStart); /* move to start point (0, 0) */
GpiPolyLine(hps, 3L, ptlTriangle); /* draw triangle */
GpiEndElement(hps); /* end element bracket */
Related Functions
- Prerequisite Functions