KeyView 24.1

# View Initialization Information

Viewing uses initialization information for its internal operations, for example, to determine which components to load. You can store this information either in an initialization file or in the Windows registry.

The initialization file is called `kvsdk.ini` and is stored in the Windows system directory.

The file used to define registry settings is called `install.reg.txt` and is stored in the `install``\redist` directory, where `install` is the directory in which you installed Viewing SDK.

You must customize the information in one of these files and specify in your application where the information is located.

## Use an Initialization File

If you are using the initialization file (`kvsdk.ini`) to set initialization information, you must modify the file to reflect your company name and application name. The sample programs demonstrate how to use an initialization file.

NOTE: A copy of the original `kvsdk.ini` file (`install.ini`) is stored in the `install``\redist` directory, where `install` is the directory in which you installed Viewing SDK. This file is not required for redistribution and is for reference only.

### Viewing API

To specify an initialization file using the Viewing API

1. Create the TPVAPICreateParams structure. Set `uProfileType` to `PROFILEDF_USE_INI`, and `lpszIniFileName` to the location of the initialization file.

   For example:

       memset (&CreateParams, 0, sizeof(TPVAPICreateParams));
       if (bUseIni)
         {
             CreateParams.uProfileType    = PROFILEDF_USE_INI;
             CreateParams.lpszIniFileName = szIniFileName;
         }
       else
         {
             CreateParams.uProfileType     = PROFILEDF_USE_REG;
             CreateParams.lpszRegistryName = REGISTRY_NAME_ASCII;
         }

2. Create the VAPI window by using the standard Windows API functions `CreateWindow()` or `CreateWindowEx()`.

### ActiveX Control

To specify an initialization file by using the ActiveX control

1. Set the RegIniMode property to `1`.

2. Set the RegIniName property to the path and name of the initialization file. For example, `kvsdk.ini` or `c:\myprogram\myini.ini`. By default, Viewing looks for the initialization file in the Windows system directory.

   For example:

       Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
           AxKEYview1.RegIniMode = 1
           AxKEYview1.RegIniName = "c:\windows\kvsdk.ini"
           AxKEYview1.Open("c:\test.doc")
       End Sub

## Use the Windows Registry File

If you are using the Windows registry to set initialization information, you must modify the registry file (`install.reg.txt`) to reflect your company name and application name. The file has a `.txt` extension for easy editing and viewing. After you have finished editing the file, remove the `.txt` extension. When your application is installed, import the `install.reg` file into the Windows Registry.

### Viewing API

To specify the Windows registry by using the Viewing API

1. Create the TPVAPICreateParams structure. Set `uProfileType` to `PROFILEDF_USE_REG`, and `lpszRegistryName` to the location of the initialization file.

   For example:

       memset (&CreateParams, 0, sizeof(TPVAPICreateParams));
       if (bUseRegistry)
         {
             CreateParams.uProfileType     = PROFILEDF_USE_REG;
             CreateParams.lpszRegistryName = REGISTRY_NAME_ASCII;
         }
       else
         {
             CreateParams.uProfileType    = PROFILEDF_USE_INI;
             CreateParams.lpszIniFileName = szIniFileName;
         }

2. Create the VAPI window by using the standard Windows API functions `CreateWindow()` or `CreateWindowEx()`.

### ActiveX Control

To specify the Windows registry by using the ActiveX control

1. Set the RegIniMode property to `2`.

2. Set the RegIniName property to the registry key under `HKEY_LOCAL_MACHINE\Software` where the Viewing initialization information resides. For example, `YourCompany\YourProduct`.

   For example:

       Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
           AxKEYview1.RegIniMode = 2
           AxKEYview1.RegIniName = "Verity\Viewing SDK"
           AxKEYview1.Open("c:\test.doc")
       End Sub

## Remove Functionality from an Application

To remove Viewing functionality from your application

1. Do not redistribute the Dynamic Link Library (DLL) associated with the component you want to remove.

   List of Files Required for Redistribution lists the files that you can redistribute with your application. It also shows the Dynamic Link Library (DLL) associated with each component.

2. In the `kvsdk.ini` file or the `install.reg.txt` file, remove references to the component that you want to remove.

For example, to remove support for Windows Animated Cursor, remove the line that references "Windows Animated Cursor" from the registry or initialization file, and do not redistribute the Windows Animated Cursor reader (`kpanirdr.dll`).

NOTE: If you remove Viewing functionality for a graphic format, and you view a document that has an embedded graphic of that format, the graphic is not displayed.

The following is a summary of files required based on functionality:

- Copy to clipboard—The following files are required for copy to clipboard functionality:

  `rtfcnv.dll`, `txtcnv.dll` (for word processor formats)

  `rtfss.dll` (for spreadsheet formats)

  `kpifutil.dll` (for picture formats)

- SaveAs to RTF—The following files are required for SaveAs to RTF functionality:

  `kvcnv.dll`

  `rtfcnv.dll` (for word processor formats)

  `rtfss.dll` (for spreadsheet formats)

  `kpifutil.dll` (for picture formats)

Copyright 2016-2023 Open Text
Version 24.1 | Last updated December 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 MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: IDOL KeyView 24.1

Topic Title: View Initialization Information