X
3935

Licensing a Callable IDL (6.2 and earlier) application with an embedded key

THIS INFORMATION ONLY PERTAINS TO SOFTWARE VERSIONS IDL 8.5, ENVI 5.3 AND PRIOR

Topic:


An application that uses Callable IDL is an application written in another programming language, such as C or C++, that calls IDL as a subroutine. A Callable IDL application contains an embedded license string along with some initialization code that it executes before its initial call to IDL. This TechTip describes how to use the embedded licensing method in your external program.Discussion:

Step 1. Obtain Your Licensing Information:
RSI Technical Support will send a text file that contains the embedded license strings that IDL uses to launch in licensed mode.

Step 2. Modify Your Application Code:
These instructions assume your code is written in C.
  • After receiving the embedded license strings, add the code provided by RSI Technical Support to your external application. The code sample below shows an example embedded license key:
         /* Callable Application license for: myapp, My App */
    /* License built for IDL Version 6.0 */
    char ** IDL_STDCALL callAppLicFunc() {
    static char *initStr[] = {
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd",
    "12345678abcdabcd" };
    return (initStr);
    }

     

  • Next, declare the following structure in the module from which you are initializing IDL:
         typedef struct _callAppLicInfo{
    unsigned long dwKey;
    char ** (IDL_STDCALL *callAppLicFunc)();
    } CALLAPPLICINFO;

     

  • Then, allocate the structure before the initializing IDL.
         CALLAPPLICINFO callAppLicInfo;

     

  • Next, initialize the structure
         callAppLicInfo.dwKey = 0xCA00CA00;
    callAppLicInfo.callAppLicFunc = callAppLicFunc;

     

  • Finally, initialize IDL with one of the following statements:
    For UNIX and Macintosh:
         if (IDL_Init_CallAppLicense(0, &callAppLicInfo))

    For Windows:

         if (!IDL_Win32Init(0, hInstance, hwnd, &callAppLicInfo))
    return(IDL_FALSE);

Step 3: Prepare the application for distribution:
Prepare the application for distribution by following the steps in "Building Your Application" and "Preparing a Distribution" in the Building IDL Applications manual, located in the IDL on-line documentation.

For more information on embedded licensing options, please see TechTip 3552: Licensing options for compiled IDL applications.Solution:
[Edit this field in the IDL-based Tech Tip Editor, v62]