Jump to content

GpiEndElement

From EDM2
Revision as of 22:38, 6 April 2025 by Iturbide (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

#define INCL_GPISEGEDITING /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS  hps; /* Presentation-space handle. */
BOOL rc;  /* Success indicator. */

rc = GpiEndElement(hps);

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
Related Functions