This documentation is archived and is not being maintained.

Interoperating with Unmanaged Code

The Microsoft .NET Framework promotes interaction with COM components, COM+ services, external type libraries, and many operating system services. Data types, method signatures, and error-handling mechanisms vary between managed and unmanaged object models. To simplify interoperation between .NET Framework components and unmanaged code and to ease the migration path, the common language runtime conceals from both clients and servers the differences in these object models.

Code executing under the control of the runtime is called managed code. Conversely, code that runs outside the runtime is called unmanaged code. COM components, ActiveX interfaces, and Win32 API functions are examples of unmanaged code.

In This Section

Exposing COM Components to the .NET Framework
Describes how to use COM components from .NET-based applications.
Exposing .NET Framework Components to COM
Describes how to use .NET-based components from COM applications.
Consuming Unmanaged DLL Functions
Describes how to call unmanaged DLL functions using platform invoke.
Design Considerations for Interoperation
Provides tips for writing integrated COM components.
Advanced COM Interop
Describes the concepts and conversion rules of COM interop.
Interop Marshaling
Describes marshaling for COM interop and platform invoke.

Related Topics

Programming with the .NET Framework
Describes how to build .NET-based applications.