#include "ltwrappr.h"

static L_INT LSettings::SetLicenseFile(pszLicenseFile, pszDeveloperKey)

L_TCHAR * pszLicenseFile;

optional feature to unlock

L_TCHAR * pszDeveloperKey;

key to unlock the feature

Sets the runtime license for LEADTOOLS and unlocks support for optional features such as LEADTOOLS Document and Medical Imaging capabilities, or PDF support.




Character string containing the name of the LEADTOOLS runtime license file to load.


 Character string containing the developer key.



The function was successful.

< 0

An error occurred. Refer to Return Codes.


Before calling this function, call LBase::LoadLibraries(LT_KRN).

You must use this function to set the runtime license for LEADTOOLS and to unlock support for any optional features that you have licensed.  If you do not set a runtime license, your application will display a "nag" message dialog at runtime, indicating that you have developed the application without a valid runtime license.


In order to obtain a runtime license and developer key, you must contact LEAD.  For more information, refer to About LEADTOOLS Deployment Licenses.

For information about LEADTOOLS Document/Medical capabilities, contact LEAD.

To determine if support for optional features has been unlocked, use the LSettings::IsSupportLocked function.

To set the runtime license from a memory buffer instead of a disk file, use the LSettings::SetLicenseBuffer function

Note: To avoid receiving WRPERR_LTKRN_DLL_NOT_LOADED return value, ensure that LBase::LoadLibraries(LT_KRN) is called prior to calling this function.

Required DLLs and Libraries


For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64.

See Also


LSettings::~LSettings, LSettings::IsSupportLocked, LSettings::SetLicenseBuffer, Class Members


Support Functions: Version and License Information


Setting a Runtime License


#define MY_LICENSE_FILE L_TEXT("d:\\temp\\TestLic.lic") 
#define MY_DEVELOPER_KEY L_TEXT("xyz123abc") 
L_INT LSettings__SetLicenseFileExample() 
   LSettings LeadSettings; 
   /* set the runtime license */ 
   LeadSettings.SetLicenseFile(MY_LICENSE_FILE, MY_DEVELOPER_KEY); 
   /* check for unlocked support */ 
   if (LeadSettings.IsSupportLocked(L_SUPPORT_MEDICAL)) 
      MessageBox(NULL, L_TEXT("Medical Locked\n"), L_TEXT(""), MB_OK); 
      MessageBox(NULL, L_TEXT("Medical Unlocked\n"), L_TEXT(""), MB_OK); 
   return SUCCESS; 

See Also

Setting a Runtime License

Help Version 20.0.2020.4.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help