Regardless of what programming language you are using, the function/method you are looking for is UnlockModules(). This is implemented on the
LMDSKernel2 object in DSKernel2.dll. Whether you are using only a specific filter or codec or you are using the main controls, you will need to unlock support using the DSKernel object. Sample code illustrating this in C, C++, and VB6 can be found in the
Using the DSKernel Object topic.
For .NET developers, this COM object is exposed through the
Leadtools.Multimedia.Common.MultimediaSupport and
Leadtools.MediaFoundation.Common.MultimediaSupport classes. The flags passed have been defined in the .NET wrappers to make the code more readable. Please note that you will still need to deploy the DSKernel2(x).dll with your application. This DLL will either need to be registered or use
registry-free activation.
With any UnlockModules() call, there are three parameters
• The unlock code
• The level at which the unlocking will be done
• An application identification string
The unlock code is provided by the LEADTOOLS Licensing Department. It is a string to embed in the application. This code is different than the serial number provided to install the SDK. Multiple unlock codes may be provided to unlock different features of the SDK, so multiple calls to UnlockModules() may be necessary in your application.
The flag provided for the level at which the unlocking will be done. For unlocking filters or codecs, the application path or computer flags can be used. These flags indicate either the specific EXE that should be allowed to use the filters or if every application on the machine can use the filters specified by the unlock code. The application flag is a special flag for unlocking support with the base SDK unlock code. This flag unlocks the specific application instance. This allows application developers using LEADTOOLS to unlock the main controls for use in their application without allowing 3rd party developers to use the LEADTOOLS controls without licensing them.
The last parameter is an application ID. This ID should be unique such that LEADTOOLS can identify your application. The LMDSKernel2 needs to be able to distinquish between two applications using LEADTOOLS on the same machine. Examples of good application IDs are a GUID or an application install path, e.g. “C:\Program Files (x86)\My Company Name\My Product Name\MyApp.exe”
Pro tip: UnlockModules() must be called each time an application is run to unlock the main controls; however, UnlockModules() calls using the App Path and Computer flags could be called just once in code used by the installer after deploying filters/codecs to a machine. Unlocking these filters/codecs each time the application is run would be redundant. Should the application be uninstalled, the installer could then run script to call LockModules() to satisfy licensing requirements.
Edited by moderator Wednesday, December 27, 2023 4:27:04 PM(UTC)
| Reason: Updated
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.