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 toNULL
.
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.