Many C and C++ developers use ODBC wrappers, for example, the Microsoft Foundation Classes. Although ODBC calls can be made through these wrappers, most of the wrappers do not allow direct ODBC calls. In these cases, you must make a call to initialize the license file.

The following procedures describe how to make this call from within a C or C++ development environment using an ODBC wrapper. The example uses the branded 32-bit Amazon Redshift Wire Protocol driver (CDrsftnn.DLL), CD as the customized prefix for the file names, and MYCompanyPWD812 as the customized password. See "Before branding the drivers" for more information about file names and passwords.

  1. Declare the SetLicenseInfo function by adding the following lines to a project header file:

    SetLicInfo.h:

    //Define the SetLicenseInfo Function

    typedef int (FAR *LibSetLicenseInfo)(LPSTR, LPSTR);

    //Global variables needed for SetLicenseInfo call

    HINSTANCE hCDrsftnn;

    //Handle to the DLL (CDrsftnn.DLL in this case)

    LibSetLicenseInfo SetLicenseInfo;

    //Pointer to SetLicInfo Function I

  2. Include the header file in your application:

    #include "SetLicInfo.h"

  3. Add code to your application to load and initialize the DLL before each ODBC connection. For example:

    //Beginning of SetLicInfo code

    hCDrsftnn=LoadLibrary("CDrsftnn.dll");

    SetLicenseInfo=(LibSetLicenseInfo);

    GetProcAddress (hCDrsftnn, "SetLicenseInfo");

    //SetLicenseInfo takes the License file name and the password

    //If the password is not 24 chars long, it must be padded with Q's

    SetLicenseInfo ("IVCD.LIC","MYCompanyPWD812QQQQQQQQQ");

    //End of SetLicInfo code

    Note: If you receive a license file error, set a breakpoint on the preceding code segment. Make sure that your application stops there before you get the license file error.