Jump to content

GpiDeleteMetaFile

From EDM2
Revision as of 18:32, 6 April 2025 by Martini (talk | contribs) (Created page with "This function deletes a metafile. ==Syntax== GpiDeleteMetaFile(hmf) ==Parameters== ; hmf (HMF) - input : Metafile handle. ==Return Value== ; rc (BOOL) - returns : Success indicator. :; TRUE :: Successful completion :; FALSE :: Error occurred. ==Remarks== This function deletes access to the specified memory metafile and makes the metafile handle invalid. ==Errors== Possible returns from WinGetLastError: ; PMERR_INV_HMF (0x207E) : An invalid metafile handle w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function deletes a metafile.

Syntax

GpiDeleteMetaFile(hmf)

Parameters

hmf (HMF) - input
Metafile handle.

Return Value

rc (BOOL) - returns
Success indicator.
TRUE
Successful completion
FALSE
Error occurred.

Remarks

This function deletes access to the specified memory metafile and makes the metafile handle invalid.

Errors

Possible returns from WinGetLastError:

PMERR_INV_HMF (0x207E)
An invalid metafile handle was specified.
PMERR_METAFILE_IN_USE (0x20D9)
An attempt has been made to access a metafile that is in use by another thread.
PMERR_TOO_MANY_METAFILES_IN_USE (0x2106)
The maximum number of metafiles allowed for a given process was exceeded.

Example Code

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

HMF     hmf;  /*  Metafile handle. */
BOOL    rc;   /*  Success indicator. */

rc = GpiDeleteMetaFile(hmf);

This example uses GpiDeleteMetaFile to delete a metafile previously loaded with GpiLoadMetaFile.

#define INCL_GPIMETAFILES /* Metafile functions */
#include <os2.h>

BOOL fSuccess; /* success indicator */
HMF hmf; /* metafile handle */
HAB hab; /* anchor block handle */

/* loads metafile from disk */
hmf = GpiLoadMetaFile(hab, "sample.met");
.
.
.
fSuccess = GpiDeleteMetaFile(hmf);

Related Functions