CreateObject Example for VB.NET
Private Sub TestCreateObject()
   'CreateObject Example
   'this sample will dynamically create a LEAD Dicom Kernel
   'object and use it to unlock DICOM support 
   Dim factory As New LTDicomKernelLib.LEADDicomFactory 
 
   Dim kernel As LTDicomKernelLib.LEADDicomKernel 
   Dim szLic As String
   szLic = "LEADTOOLS OCX Copyright (c) 
 1991-2005 LEAD Technologies, Inc."
   kernel = factory.CreateObject("LEADDicomKernel.LEADDicomKernel", 
 szLic) 
   kernel.EnableMethodErrors 
 = False 
   kernel.UnlockSupport(LTDicomKernelLib.DicomSupportLockConstants.L_SUPPORT_DICOM, 
 "MyUnlockKey") 
   If (kernel.IsSupportLocked(LTDicomKernelLib.DicomSupportLockConstants.L_SUPPORT_DICOM)) 
 Then 
      MessageBox.Show("Unlock Failed!") 
 
   End If 
End Sub