Using the DSKernel Object
C++ Example
In order to use the DSKernel object, you must create an instance of the LMDSKernel2 class. This is accomplished by using the Win32 CoCreateInstance function.
1. |
To create the DSKernel object, use the following code: |
#include "ILMDSKernel2.h"
ILMDSKernel2* pKernel = NULL;
HRESULT hr = CoCreateInstance(CLSID_LMDSKernel2, NULL, CLSCTX_INPROC_SERVER, IID_ILMDSKernel2, (void**) &pKernel);
2. |
To use the unlock method, use the following code: |
|
|
a. |
To unlock all video filters at the computer level, use the following code: |
pKernel->UnlockModule(“All video filters serial number”, UNLOCK_COMPUTER, “Application ID”);
|
b. |
To unlock the MPEG4 encoder at the computer level, use the following code: |
pKernel->UnlockModule(“MPEG4 encoder serial number”, UNLOCK_COMPUTER, “Application ID”);
|
c. |
To unlock a filter at the application level, use the following code: |
pKernel->UnlockModule(“Filter serial number”, UNLOCK_APP_ONCE, Application ID);
3. |
To use the lock method, use the following code: |
|
|
a. |
To lock all video filters at the computer level, use the following code: |
pKernel->LockModules(“Application ID”, LOCK_COMPUTER);
|
b. |
To lock the MPEG4 encoder at the application level, use the following code: |
pKernel->LockModules(“Application ID”, LOCK_APP);
4. |
Free the DSKernel object as follows: |
|
|
a. |
pKernel->Release(); |
VB Example
1. |
To create the DSKernel object, add the DSKernel reference to the project using the “Project->Reference” menu item. |
2. |
Declare the DSKernel object as follows: |
Dim pKernel As LMDSKernel2
3. |
Create the DSKernel object as follows: |
Set pKernel = New LMDSKernel2
4. |
To use the unlock method, use the following code: |
|
|
a. |
To unlock all video filters at the computer level, use the following code: |
pKernel.UnlockModule “All video filters serial number”, UNLOCK_COMPUTER, “Application ID”
|
b. |
To unlock MPEG4 encoder at the computer level, use the following code: |
pKernel.UnlockModule “MPEG4 encoder serial number”, UNLOCK_COMPUTER, “Application ID”
|
c. |
To unlock a filter at the application level, use the following code: |
pKernel.UnlockModule “Filter serial number”, UNLOCK_APP_ONCE, “Application ID”
5. |
To use the lock method, use the following code: |
|
|
a. |
To lock all video filters at the computer level, use the following code: |
pKernel.LockModules “Application ID”, LOCK_COMPUTER
|
b. |
To lock the MPEG4 encoder at the application level, use the following code: |
pKernel.LockModules “Application ID”, LOCK_APP
6. |
Free the DSKernel object as follows: |
Set pKernel = Nothing
C Demos
In C demos, you need to use the UnlockSupport and the LockSupport methods to unlock and lock the LTMM. These methods are available in UnlockSupport.h and UnlockSupport.c files that located in the \c\common folder in the Multimedia Toolkit Example folder. The UnlockSupport.c file contains the following array:
static LPCWSTR ppszBaseKeys[] =
{
LTMM_SERIAL_NUMBER,
// Multimedia
Toolkit serial number (defined in ltmmSerialNumber.h)
//
insert additional Base keys here
NULL, //
terminates array
};
This array contains the #define LTMM_SERIAL_NUMBER L"MySerial" define that has the LTMM serial number to be used to unlock the Multimedia Toolkit functionality. The mentioned key is defined in the \include\ltmmSerialNumber.h file in the LTMM installation folder. You need to replace “MySerial” with a valid serial number in order for the toolkit to operate in release (non-evaluation) mode.
If you want to unlock additional keys, perform the following steps:
1. |
Add a new define in the LtmmSerialNumber.h for the new module (i.e. DVDBURNER_SERIAL_NUMBER). |
2. |
Add this define to the ppszBaseKeys array in UnlockSupport.c. |
Note: It is important that your application relock support before exiting to free resources allocated by the lock.
C++ demos
In C++ demos, you need to use the UnlockSupport and the LockSupport methods to unlock and lock the LTMM. These methods are available in the UnlockSupport.h and UnlockSupport.cpp files that are located in the \cpp\common folder in the Multimedia Toolkit example folder. The UnlockSupport.cpp file contains the following array:
static LPCWSTR ppszBaseKeys[] =
{
LTMM_SERIAL_NUMBER,
// Multimedia Toolkit serial number (defined in ltmmSerialNumber.h)
// insert additional Base keys here
NULL,
// terminates array
};
This array contains the #define LTMM_SERIAL_NUMBER L"MySerial" define that has the LTMM serial number to be used to unlock the Multimedia Toolkit functionality. The mentioned key is defined in the \include\ltmmSerialNumber.h file in the LTMM instillation folder. You need to replace “MySerial” with a valid serial number in order for the toolkit to operate in release (non-evaluation) mode.
If you want to unlock additional keys, perform the following steps:
1. |
Add a new define in the LtmmSerialNumber.h for the new module (i.e. DVDBURNER_SERIAL_NUMBER). |
2. |
Add this define to the ppszBaseKeys array in UnlockSupport.c. |
Note: It is important that your application relock support before exiting to free resources allocated by the lock.
VB6 demos
In VB6 demos, you need to use the UnlockSupport and the LockSupport methods (macros) to unlock and lock the LTMM. These methods are available in the UnlockSupport.bas file that is located in the \vb\common folder in the Multimedia Toolkit example folder. The demo should contain the following array:
Dim ppszBaseKeys(1) As String
ppszBaseKeys(0) = LTMM_SERIAL_NUMBER
This array contains the Public Const LTMM_SERIAL_NUMBER = "MySerial" define that has the LTMM serial number to be used to unlock the Multimedia Toolkit functionality. The mentioned key is defined in the ltmmSerialNumber.bas file that is located in the \vb\common folder in the Multimedia Toolkit example folder. You need to replace “MySerial” with a proper serial number in order for the toolkit to operate in release (non-evaluation) mode.
If you want to unlock additional keys, perform the following steps:
1. |
Add a new define in the LtmmSerialNumber.bas for the new module (i.e. DVDBURNER_SERIAL_NUMBER). |
2. |
Add this define to the ppszBaseKeys array in your application. |
Note: It is important that your application relock support before exiting to free resources allocated by the lock.
C# demos
In C# demos, you need to use the Unlock and the Lock methods from the UnlockSupport class to unlock and lock the LTMM. These methods are available in the UnlockSupport.cs file that is located in the \DotNet\CS\common folder in the Multimedia Toolkit example folder. The demo should contain the following array:
string[] ppszBaseKeys =
{
LtmmSerialNumber.LTMM_SERIAL_NUMBER, // multimedia toolkit serial number (defined in ltmmSerialNumber.cs)
// insert additional Base keys here
};
This array contains the static public string LTMM_SERIAL_NUMBER = "MySerial" define that has the LTMM serial number to be used to unlock the Multimedia Toolkit functionality. The mentioned key is defined in the ltmmSerialNumber.cs file that is located in the \DotNet\CS\common folder in the Multimedia Toolkit example folder. You need to replace “MySerial” with a valid serial number in order for the toolkit to operate in release (non-evaluation) mode.
If you want to unlock additional keys, perform the following steps:
1. |
Add a new define in the LtmmSerialNumber.cs for the new module (i.e. DVDBURNER_SERIAL_NUMBER). |
2. |
Add this define to the ppszBaseKeys array in your application. |
Note: It is important that your application relock support before exiting to free resources allocated by the lock.
VB.NET demos
In C# demos, you need to use the Unlock and the Lock methods from the UnlockSupport class to unlock and lock the LTMM. These methods are available in the UnlockSupport.vb file that is located in the \DotNet\VB\common folder in the Multimedia Toolkit example folder. The demo should contain the following array:
Dim unlocklsprt As New UnlockSupport
Dim ppszBaseKeys() As String = {LtmmSerialNumber.LTMM_SERIAL_NUMBER}
This array contains the Public Shared LTMM_SERIAL_NUMBER As String = "MySerial" define that has the LTMM serial number to be used to unlock the Multimedia Toolkit functionality. The mentioned key is defined in the ltmmSerialNumber.vb file that is located in the \DotNet\VB\common folder in the Multimedia Toolkit example folder. You need to replace “MySerial” with a valid serial number in order for the toolkit to operate in release (non-evaluation) mode.
If you want to unlock additional keys, perform the following steps:
1. |
Add a new define in the LtmmSerialNumber.vb for the new module (i.e. DVDBURNER_SERIAL_NUMBER). |
2. |
Add this define to the ppszBaseKeys array in your application. |
Note: It is important that your application relock support before exiting to free resources allocated by the lock.