Прочетете на английски Редактиране

Споделяне чрез


Marshal.GetTypeForITypeInfo(IntPtr) Method

Definition

Converts an unmanaged ITypeInfo object into a managed Type object.

C#
public static Type GetTypeForITypeInfo(IntPtr piTypeInfo);
C#
[System.Security.SecurityCritical]
public static Type GetTypeForITypeInfo(IntPtr piTypeInfo);

Parameters

piTypeInfo
IntPtr

The ITypeInfo interface to marshal.

Returns

A managed type that represents the unmanaged ITypeInfo object.

Attributes

Remarks

GetTypeForITypeInfo returns a System.Type instance that is based on the original type. You can apply the System.Runtime.InteropServices.MarshalAsAttribute to replace standard interop marshaling behavior with this custom marshaler. The Tlbimp.exe (Type Library Importer) tool uses the custom marshaler to translate ITypeInfo parameters to System.Type parameters. However, if you obtain an ITypeInfo interface by some means other than Tlbimp.exe, you can use GetTypeForITypeInfo to manually perform the same translation.

Applies to

Продукт Версии
.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

See also