About COM Export Object Examples

An IDL object can be wrapped for use in a COM application using the Export Bridge Assistant as described in Using the Export Bridge Assistant. This chapter provides several Visual Basic .NET examples that use custom COM export objects. These include:

The general process for each of these examples involves the following:

  1. Create the object in IDL.
  2. Export the object using the Export Bridge Assistant, which creates the .dll, .tlb or .ocx files associated with the IDL object that is now wrapped in a COM export object wrapper.
  3. Register the .dll or .ocx file.
  4. Reference the appropriate library in your COM application before attempting to access the object functionality. This functionality automatically includes stock methods and events (described in Using Exported COM Objects) in addition to custom methods you have chosen to export.
  5. Note
    See Writing IDL Objects for Exporting for information on how to create custom IDL objects that can be successfully exported using the Export Bridge Assistant. There are important object method and data type requirements that must be met.

    Note
    When you distribute an application, you will also need to share:
         – any application-specific .dll files generated during the build process
         – the executable file (.exe)
         – the .dll or .ocx files (generated by the Export Bridge Assistant)
         – the .pro or .sav file that contains the custom object definition
    Any .pro or .sav files included with your application must be located in the IDL path.

Debugging Applications Using Export Objects

It can be challenging to determine what is happening in the IDL process associated with a wrapper object without the debugging features of the IDL Workbench. For access to valuable debug information, consider using the IDL_BRIDGE_DEBUG environment variable, described in Debugging COM Wrapper Objects.