UnlockModule Method

Summary

Unlocks a specific module, or group of modules (depending on the serial number, or Key).

Syntax
C#
VB
C++
public static void UnlockModule( 
   string unlockKey, 
   LockType type, 
   string appId 
) 
Public Shared Sub UnlockModule( _ 
   ByVal unlockKey As String, _ 
   ByVal type As LockType, _ 
   ByVal appId As String _ 
)  
public: 
static void UnlockModule(  
   String^ unlockKey, 
   LockType type, 
   String^ appId 
)  

Parameters

unlockKey
A string that represents the module serial number. This parameter cannot be NULL (empty).

type
The LockType enumeration value that specifies the level at which the unlocking operation will be performed.

appId
If type contains LockType.Application or LockType.Computer: The application ID; a unique ID of the calling application. The caller is responsible for uniqueness of this ID. It is recommended to use the full path of the application.

If Flags contains LockType.ApplicationPath: The application full path of the application (the long version, not the short 8.3 version of the path).

This parameter cannot be NULL (empty).

Remarks

Use this method to change the state for the modules that are unlocked to Release. Please note the following:

  • The Key is a unique module serial number that must be purchased from LEAD.
  • It may be necessary to call the function several times to unlock several modules (or filters/codecs).
  • Each module has its own key, but some keys can unlock more than one filter/module.
  • The AppID is used to uniquely identify the calling application. The AppID must be set to the application path if you unlock using LockType.ApplicationPath.

You should call LockModules when the app exits or is uninstalled.

Example
C#
VB
using Leadtools; 
using Leadtools.MediaFoundation; 
using LeadtoolsMediaFoundationExamples.Fixtures; 
 
public bool _result = false; 
 
public void MultimediaSupportExample() 
{ 
   // pszKey is a string containing the serial number. It is defined like this: 
   // string pszKey = "MySerial"; 
   string pszAppId = "My Test Application"; 
 
   try 
   { 
      // unlock the multimedia feature 
      Leadtools.MediaFoundation.Common.MultimediaSupport.UnlockModule(pszKey, 
                                                                 Leadtools.MediaFoundation.Common.LockType.Application, 
                                                                 pszAppId); 
   } 
   catch 
   { 
      return; 
   } 
 
   // [use the multimedia feature here] 
 
   // lock the multimedia feature before exiting the app 
   try 
   { 
      Leadtools.MediaFoundation.Common.MultimediaSupport.LockModules(Leadtools.MediaFoundation.Common.LockType.Application, 
                                                                pszAppId); 
   } 
   catch 
   { 
      return; 
   } 
   _result = true; 
} 
Imports Leadtools 
Imports Leadtools.MediaFoundation 
Imports LeadtoolsMediaFoundationExamples.Fixtures 
 
Public _result As Boolean = False 
 
Public Sub MultimediaSupportExample() 
   ' pszKey is a string containing the serial number. It is defined like this: 
   ' Private pszKey As String = "MyString" 
   Dim pszAppId As String = "My Test Application" 
 
   Try 
      ' unlock the multimedia feature 
      Leadtools.MediaFoundation.Common.MultimediaSupport.UnlockModule(pszKey, 
                                                                 Leadtools.MediaFoundation.Common.LockType.Application, 
                                                                 pszAppId) 
   Catch 
      Exit Sub 
   End Try 
 
   ' [use the multimedia feature here] 
 
   ' lock the multimedia feature before exiting the app 
   Try 
      Leadtools.MediaFoundation.Common.MultimediaSupport.LockModules(Leadtools.MediaFoundation.Common.LockType.Application, pszAppId) 
      _result = True 
   Catch e1 As Exception 
      _result = False 
   End Try 
End Sub 

Requirements

Target Platforms

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

Leadtools.MediaFoundation Assembly