Bagikan melalui


Marshaling Data with COM Interop

COM interop provides support for both using COM objects from managed code and exposing managed objects to COM. Support for marshaling data to and from COM is extensive and almost always provides the correct marshaling behavior.

The Windows Software Development Kit (SDK) includes the following COM interop tools:

  • Type Library Importer (Tlbimp.exe), which converts a COM type library to an interop assembly. From this assembly, the interop marshaling service generates wrappers that perform data marshaling between managed and unmanaged memory.

  • Type Library Exporter (Tlbexp.exe), which produces a COM type library from an assembly and generates a wrapper that performs marshaling during method calls.

This section describes the processes for customizing interop wrappers when you can (or must) supply the marshaler with additional type information.

In This Section