KeyView 23.2

# fpInit()

This function initializes a Filter session.

## Syntax

    KVErrorCode pascal fpInit(
            const char* pszKeyViewDir,
            const char* pszLicense,
            const KVFilterInitOptions* pOptions,
            KVFilterSession* pSession
    );

## Arguments

`pszKeyViewDir` | A pointer to a string that contains the path of the KeyView Filter directory (where the readers and the `formats.ini` file are located). This is normally the `install\PLATFORM\bin` directory.
`pszLicense` | A pointer to a string that contains your license key, as provided by OpenText. Copy the key exactly, with no leading or trailing spaces.
`pOptions` | A pointer to a KVFilterInitOptions structure that specifies configuration options for the new KeyView Filter session. You must initialize this structure with the `KVStructInit()` macro before modifying the structure as necessary. See KVFilterInitOptions for information about the options you can set.
`pSession` | A pointer to a KeyView Filter session that you want to initialize. When you call `fpInit()`, the pointer is set to the address of the new session context.

## Returns

The function returns an error code.

- When initialization is successful, the error code is `KVError_Success` and the session context is stored in `*pSession`. Use the Filter session in future calls to KeyView - it must be passed as the first argument to some of the File Extraction API and Filter API functions.
- When initialization is unsuccessful, the return value is an error code (see KVErrorCode for more information), and `*pSession` is set to `NULL`.

## Discussion

- On Windows, `pszKeyViewDir` must be in the local Windows code page.
- To make sure that multi-threaded filter processes are thread-safe, you must create a unique context pointer for every thread by calling `fpInit()`. In addition, threads must not share context pointers, and you must use the same context pointer for all API calls in the same thread. Creating a context pointer for every thread does not affect performance because the context pointer uses minimal resources.
- When the filtering context is no longer required, call fpShutdown() to terminate it.

Copyright 2016-2023 Open Text
Version 23.2 | Last updated March 2023

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL KeyView 23.2

Topic Title: fpInit()