fpInitWithLicenseData()

This function initializes an Export session with license information passed in function parameters rather than a license file. Its return value, pContext, is passed as the first parameter to the File Extraction interface and all other Export functions.

This function is similar to fpInit(), but it uses a different licensing method. You can use either fpInit() or fpInitWithLicenseData to initialize your Export session. However, these functions are mutually exclusive. That is, neither takes the context pointer from the other as an argument. If you call both functions, you initialize two distinct Export sessions, in the same way as calling fpInit() twice.

Syntax

void* pascal _export fpInitWithLicenseData(
    KVMemoryStream*    pMemAllocator,
    char*              pszKeyViewDir,
    const char* const  pszLicenseOrganization
    const char* const  pszLicenseKey
    char*              pszDataFile,
    KVErrorCode*       pError,
    DWORD              dWord);

Arguments

pMemAllocator

This argument is deprecated in KeyView 12.10.0 and later, and should be NULL. If it is not, KeyView may use the functions in this developer-defined memory allocator to allocate memory.

pszKeyViewDir

A pointer to the directory where the Export components are located. This is normally the directory install\OS\bin, where install is the path name of the Export installation directory and OS is the name of the operating system.

pszLicenseOrganization A pointer to a string that contains the organization name under which this installation of KeyView is licensed. This value is the company name that appears at the top of the license key provided by Micro Focus. Add the text exactly as it appears in this file.
pszLicenseKey A pointer to a string that contains the license key for this installation of KeyView. This value is the appropriate license key provided by Micro Focus. The key is a string that contains 31 characters, for example 2TQD22D-2M6FV66-2KPF23S-2GEM5AB. Type these characters exactly as they appear in the license key file, including the dashes, but do not include any leading or trailing spaces.

pszDataFile

A pointer to the directory and file name of the Export data file, formats_e.ini. This file determines whether a format is supported. If a format does not exist in this file, the conversion fails.

The formats_e.ini file is normally stored in the directory install\OS\bin, where install is the path name of the Export installation directory and OS is the name of the operating system. See File Format Detection for more information.

pError

A pointer to an error code defined in KVErrorCode or KVErrorCodeEx in kverrorcodes.h. See KVErrorCode and KVErrorCodeEx.

dWord

Reserved. Must be 0.

Returns

Discussion

Example

The following sample code is from the cnv2xml sample program:

pKVXML = (*KVXMLInt.fpInitWithLicenseData)(NULL, ".", YOUR_LICENSE_ORGANIZATION, YOUR_LICENSE_KEY, NULL, &error, 0);
if(!pKVXML)
{
    printf("Error initializing KVXML: %d\n", error);
    mpFreeLibrary(hKVXML);
    return 4;
}