This function initializes a Filter session. Its return value, pContext, is passed as the first argument to the File Extraction interface and all other Filter functions.


void * pascal fpInit( 
    KVMemoryStream  *pMemAllocator,
    KVDynLink       *pDynLink,
    char            *pszKeyViewDir,
    KVCharSet        outputCharSet,
    DWORD            dwFlags );


pMemAllocator A pointer to a developer-defined memory allocator. If NULL is passed, the default C run-time memory allocation is used.
pDynLink This argument is reserved. It must be NULL.
pszKeyViewDir A pointer to the directory where the Filter components (such as the formats.ini file, license key file (kv.lic), and file filters) are located. This is normally the install\OS\bin directory.

The character set to use for textual output when the source character set can be determined from the document or is specified by fpSetSrcCharSet().

The character sets are enumerated in KVCharSet in kvtypes.h.

dwFlags Instructions on how to process a file or stream. See Flags for dwFlags for more information.

Flags for dwFlags


Reserved for internal use.


Reserved for internal use.

KVF_OUTOFPROCESS Enables out-of-process filtering. This is enabled by default. See The Filter Process Model.
KVF_INPROCESS Enables in-process filtering. See The Filter Process Model.
KVF_HEADERFOOTERTAGS Puts tags around header and footer data.
KVF_HEADERFOOTER Extracts headers and footers.
KVF_UNICODEMSBLSB Uses the byte order for Big Endian systems (MSBLSB) for Unicode text. MSBLSB is the "Most Significant Byte Least Significant Byte."
KVF_UNICODELSBMSB Uses the byte order for Little Endian systems (LSBMSB) for Unicode text. LSBMSB is the "Least Significant Byte Most Significant Byte."
KVF_UNICODEMARKER Generates the byte order marker for Unicode text.
KVF_NOCHARSETCONVERT Prevents default conversion of document character encoding. See Prevent the Default Conversion of a Character Set.
KVF_OOPLOGON Enables the out-of-process error log. See Enable or Disable Error Logging.
KVF_OOPMEMTRACEON Enables memory trace for the out-of-process error log. See Report Memory Errors.
KVF_OOPLOGOFF Disables the out-of-process error log. Enable or Disable Error Logging.
KVF_OOPMEMTRACEOFF Disables memory trace for the out-of-process error log. See Report Memory Errors.

This flag is used by the Container API which is obsolete.

It filters the main file and subfiles of a container file by using the standard filtering functions, and extracts the text to a single file.



Set these flags in fpInit() or fpOpenStreamEx2() to specify whether files are detected out of process or in process for a filtering session. These flags override the default_detect_inprocess flag in formats.ini.

If you set neither of these flags, file detection behavior is determined by the KVF_OUTOFPROCESS or KVF_INPROCESS flags in these calls. If you do not set these flags, behavior is determined by default_detect_inprocess in formats.ini.

See Run File Detection In or Out of Process.