COM Interop Services Enhancements

You can incorporate COM components into your .NET Framework application by using COM interop tools to import the relevant COM types. Once imported, the COM types are ready to use. At run time, the common language runtime marshals data between COM objects and managed objects as needed. Four major enhancements in the .NET Framework 2.0 make it easier for you to achieve interoperability with COM:

  • You can use the new SafeHandle and CriticalHandle classes, and their specialized derived classes, to safely and reliably manipulate operating system handles.
  • You can now interoperate with native code more easily by wrapping native function pointers into delegates and by marshaling fixed-size arrays of structures inside structures.
  • Calls you make between applications in different application domains now perform much faster for common call types.
  • Your build environment is now more robust because new switches on the Type Library Importer (Tlbimp.exe) and Type Library Exporter (Tlbexp.exe) eliminate dependency on the registry to resolve type library references.