Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.21
Programming With LEADTOOLS COM Interoperability Functions

LEADTOOLS "wraps" the .NET functionality documented in this help collection to provide interoperability for COM methods, properties, constructors, and events.

.NET Modifications for COM Interoperability In order to make COM interoperability compliant with other languages like VB.6 and VC++, the following modifications have been made:
  • Methods. COM methods are similar to .Net methods, except that the type or the return values of some methods have been changed. For example, IntPtr is changed to Int32 and Byte[] is converted to a property.
  • Properties. COM properties are similar to .NET properties, except that the types of some of the properties have been changed. For example, an IntPtr type is changed to be an Int32 type. In some cases new properties have been added to make the methods work properly. As an example, all byte[] parameters were removed from method signatures and were converted to properties. These must be filled before or after the method is called.
  • Constructors Some constructors depend on other properties. When using certain languages (for example, VB) these properties must befilled before the Ctor methods are called.
  • Events: COM events are similar to .NET toolkit events, except that new properties have been added to make them work with other languages. For example, all byte[] parameters were removed from event signatures and were converted to properties. These properties are filled before or after the event is fired. In addition, the EnableEvent and DisableEvent methods have been added to enable/disable the events. Note: In order to get LEADTOOLS control events to fire from your application, you must first define a member variable of the control type and add the needed control event from this variable. The following example uses the LTDWinformsInterop.RasterImageViewer control:
    'Assume your have the RasterImageViewer control added to your form and named RasterImageViewer1.
                 Dim WithEvents MyViewer As LTDWinFormsInterop.RasterImageViewer
                 Private Sub Form_Load()
                    RasterImageViewer1.EnableEvent RasterImageViewerEventsIDs_OnAutoScrollChanged
                    Set MyViewer = RasterImageViewer1
                 End Sub
                 Private Sub MyViewer_OnAutoScrollChanged()
                    'Write your code here
                 End Sub
                 
  • Tutorials:: The following tutorials provide model programs for basic COM functions:

For more information, refer to: