UnmanagedMarshal.DefineUnmanagedMarshal Method

Specifies a given type that is to be marshaled to unmanaged code.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

public static UnmanagedMarshal DefineUnmanagedMarshal(
	UnmanagedType unmanagedType
)

Parameters

unmanagedType
Type: System.Runtime.InteropServices.UnmanagedType

The unmanaged type to which the type is to be marshaled.

ExceptionCondition
ArgumentException

The argument is not a simple native type.

The UnmanagedType passed to this method must be a simple native type. None of the following values may be used: UnmanagedType.ByValTStr, UnmanagedType.SafeArray, UnmanagedType.ByValArray, UnmanagedType.LPArray, or UnmanagedType.CustomMarshaler.

Only unmanaged marshal constructs can be made using this method.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft