Custom Marshaling
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Custom Marshaling 

A custom marshaler enables you to precisely control the way in which a managed type is exposed to COM or an unmanaged type is exposed to the .NET Framework. You use a custom marshaler instead of the interop marshaler, which the common language runtime provides by default.

In This Section

Custom Marshaling Overview

Describes the custom marshalers at a high level.

Defining the Marshaling Type

Describes how to prepare the interfaces involved in setting up a custom marshaler.

Implementing the ICustomMarshaler Interface

Describes the options in preparing a custom marshaler.

Using a Substitute Marshaler

Describes how to use the MarshalAsAttribute attribute to insert a custom marshaler.

Related Sections

Interop Marshaling

Describes marshaling for COM interop and platform invoke.

© 2015 Microsoft