Jump to content

mmioRemoveElement

From EDM2

The mmioRemoveElement function removes a specific element from a compound file. mmioRemoveElement is a 32-bit function that is also provided as a 16-bit entry point.

Syntax

#define INCL_MACHDR
#include <os2.h>

ULONG mmioRemoveElement(PSZ pszFileElement, ULONG ulFlag);

Parameters

pszFileElement (PSZ) - input
Pointer to a compound-file element name in the format: `a:\path\file+element`.
ulFlag (ULONG) - input
Specifies possible options. Contains 0 or the following flag:
  • MMIO_RE_COMPACT: Compacts the compound file after removing the element. If no element is specified but this flag is set, the compound file will be compacted. If the element is specified but does not exist, no file compaction is done.

Return Value

rc (ULONG) - returns
Returns `MMIO_SUCCESS` if there was no error; otherwise it returns an error code.
  • MMIOERR_CF_ENTRY_NOT_FOUND: Element can not be found.
  • MMIOERR_INVALID_PARAMETER: No element name specified in the pszFileElement parameter and the `MMIO_RE_COMPACT` flag is not set.

Remarks

The **mmioRemoveElement** function is a high-level interface to remove an element from a compound file.

Example Code

The following code illustrates how to remove an element from a compound file and compact it after it is removed.

  ULONG ulReturnCode;

  ulReturnCode = mmioRemoveElement("test.bnd+element", MMIO_RE_COMPACT);

  if (ulReturnCode) {
     /* error */
  } else {
     /* success */
  }

Related Functions