gpi12.hlp (Table of Contents; Topic list)
GpiDestroyPS (1.2)
Function Group  Overview  Changes               Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPICONTROL
 
BOOL GpiDestroyPS(hps)
HPS hps;    /* presentation-space handle */
 
The GpiDestroyPS function destroys the presentation space and releases all
resources owned by the presentation space. This function should only be used
to destroy presentation spaces created by the GpiCreatePS function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR 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_PS_BUSY
     PMERR_PS_IS_ASSOCIATED
 
Example
 
This example uses the GpiDestroyPS function to destroy the presentation
space associated with a memory device context.
 
HDC hdc;
HPS hps;
SIZEL page = { 0, 0 };
 
/* Create the memory device context and presentation space. */
 
hdc = DevOpenDC(hab, OD_MEMORY, "*", 0L, (PDEVOPENDATA) NULL, (HDC) NULL);
hps = GpiCreatePS(hab, hdc, &page, PU_PELS | GPIT_MICRO | GPIA_ASSOC);
    .
    .
    .
GpiAssociate(hps, (HDC) NULL);
GpiDestroyPS(hps);    /* destroys presentation space */
DevCloseDC(hdc);      /* closes device context       */
 
See Also
 
GpiCreatePS