TypeToTypeInfoMarshaler.MarshalManagedToNative(Object) Method

Definition

Marshals an object from managed code to unmanaged code.

C#
public override IntPtr MarshalManagedToNative(object pManagedObj);
C#
public virtual IntPtr MarshalManagedToNative(object pManagedObj);

Parameters

pManagedObj
Object

The managed object to be converted.

Returns

IntPtr

A pointer to the unmanaged object.

Implements

Exceptions

pManagedObj is null.

Remarks

The CLR calls this method with the specified instance of a managed object to convert that object from managed code to unmanaged code, and it returns a pointer to the appropriate unmanaged object, representing the COM view of that object.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1