Jump to content

GpiCloseSegment: Difference between revisions

From EDM2
No edit summary
No edit summary
Line 1: Line 1:
This function closes the current segment.  
This function closes the current segment.  
==Syntax==
==Syntax==
  GpiCloseSegment (hps)
  GpiCloseSegment (hps)
Line 11: Line 10:
*TRUE - Successful completion
*TRUE - Successful completion
*FALSE - Error occurred.
*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_INV_MICROPS_FUNCTION (0x20A1)
:An attempt was made to issue a function that is invalid in a micro presentation space.
;PMERR_NOT_IN_SEG (0x20E3)
:An attempt was made to end a segment using GpiCloseSegment while not in a segment bracket.
;PMERR_PATH_INCOMPLETE (0x20EC)
:An attempt was made to open or close a segment either directly or during segment drawing, or to issue GpiAssociate while there is an open path bracket.
;PMERR_AREA_INCOMPLETE (0x2005)
:One of the following has occurred: o A segment has been opened, closed, or drawn.
:*GpiAssociate was issued while an area bracket was open.
:*A drawn segment has opened an area bracket and ended without closing it.


==Example Code==
==Example Code==

Revision as of 02:08, 20 September 2025

This function closes the current segment.

Syntax

GpiCloseSegment (hps)

Parameters

hps (HPS) - input
Presentation-space handle.

Returns

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_INV_MICROPS_FUNCTION (0x20A1)
An attempt was made to issue a function that is invalid in a micro presentation space.
PMERR_NOT_IN_SEG (0x20E3)
An attempt was made to end a segment using GpiCloseSegment while not in a segment bracket.
PMERR_PATH_INCOMPLETE (0x20EC)
An attempt was made to open or close a segment either directly or during segment drawing, or to issue GpiAssociate while there is an open path bracket.
PMERR_AREA_INCOMPLETE (0x2005)
One of the following has occurred: o A segment has been opened, closed, or drawn.
  • GpiAssociate was issued while an area bracket was open.
  • A drawn segment has opened an area bracket and ended without closing it.

Example Code

Declaration:

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

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

rc = GpiCloseSegment(hps);