GpiEndElement: Difference between revisions
Appearance
Created page with "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 acce..." |
mNo edit summary |
||
| Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
; hps ([[HPS]]) - input | ; hps ([[HPS]]) - input: Presentation-space handle. | ||
: Presentation-space handle. | |||
==Return Value== | ==Return Value== | ||
; rc ([[BOOL]]) - returns | ; rc ([[BOOL]]) - returns: Success indicator. | ||
: Success indicator. | :: TRUE - Successful completion | ||
: | :: FALSE - Error occurred. | ||
: | |||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError: | Possible returns from WinGetLastError: | ||
; PMERR_INV_HPS (0x207F) | ; PMERR_INV_HPS (0x207F): An invalid presentation-space handle was specified. | ||
: 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_PS_BUSY (0x20F4) | ; 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. | ||
: 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== | ==Example Code== | ||
This example uses the GpiEndElement function to end an element bracket. | This example uses the GpiEndElement function to end an element bracket. | ||
<pre> | <pre> | ||
#define INCL_GPISEGEDITING /* GPI Segment Edit functions */ | #define INCL_GPISEGEDITING /* GPI Segment Edit functions */ | ||
#include | #include <os2.h> | ||
HPS hps; /* presentation space handle */ | HPS hps; /* presentation space handle */ | ||
POINTL ptlStart = { 0, 0 }; /* first vertex */ | POINTL ptlStart = { 0, 0 }; /* first vertex */ | ||
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices */ | POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices */ | ||
. | . | ||
. | . | ||
Latest revision as of 01:06, 17 November 2025
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