Jump to content

GpiQueryMetaFileLength

From EDM2

This function returns the total length of a memory metafile, in bytes.

Syntax

GpiQueryMetaFileLength(hmf)

Parameters

hmf (HMF) - input
Memory-metafile handle.

Return Value

lLength (LONG) - returns
Total length of the metafile.
>=0
Total length of the metafile
GPI_ALTERROR
Error.

Remarks

This function is normally used before GpiQueryMetaFileBits.

Errors

Possible returns from WinGetLastError:

PMERR_INV_HMF (0x207E)
An invalid metafile handle was specified.
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;     /* Memory-metafile handle. */
LONG    lLength; /* Total length of the metafile. */

lLength = GpiQueryMetaFileLength(hmf);

This example uses GpiQueryMetaFileLength to query the byte length of a memory metafile.

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

HMF hmf; /* memory-metafile handle */
LONG lLength; /* length of metafile */

lLength = GpiQueryMetaFileLength(hmf);

Related Functions