Permalink
306c608 Jul 28, 2017
@guardrex @tompratt-AQ @yishengjin1413
64 lines (53 sloc) 3.19 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Interoperating with Unmanaged Code
03/30/2017
.net-framework
dotnet-clr
article
VB
CSharp
C++
jsharp
unmanaged code, interoperation
managed code, interoperation with unmanaged code
.NET Framework, interoperation with unmanaged code
unmanaged code
interoperation with unmanaged code
interoperation with unmanaged code, about interoperation
components [.NET Framework], interoperation with unmanaged code
ccb68ce7-b0e9-4ffb-839d-03b1cd2c1258
15
rpetrusha
ronpet
wpickett

Interoperating with Unmanaged Code

The .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 that executes 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

Interoperating with Unmanaged Code How-to Topics
Provides links to all How-to topics found in the conceptual documentation for interoperating with unmanaged code.

Exposing COM Components to the .NET Framework
Describes how to use COM components from .NET Framework applications.

Exposing .NET Framework Components to COM
Describes how to use .NET Framework 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.

Interop Marshaling
Describes marshaling for COM interop and platform invoke.

How to: Map HRESULTs and Exceptions
Describes the mapping between exceptions and HRESULTs.

Interoperating Using Generic Types
Describes the behavior of generic types when used in COM interop.

Related Sections

Advanced COM Interoperability
Provides links to more information about incorporating COM components into your .NET Framework application.