MarshalAsAttribute 构造函数

定义

初始化 MarshalAsAttribute 类的新实例。

重载

MarshalAsAttribute(Int16)

使用指定的 UnmanagedType 值初始化 MarshalAsAttribute 类的新实例。

MarshalAsAttribute(UnmanagedType)

使用指定的 UnmanagedType 枚举成员初始化 MarshalAsAttribute 类的新实例。

MarshalAsAttribute(Int16)

使用指定的 UnmanagedType 值初始化 MarshalAsAttribute 类的新实例。

public:
 MarshalAsAttribute(short unmanagedType);
public MarshalAsAttribute (short unmanagedType);
new System.Runtime.InteropServices.MarshalAsAttribute : int16 -> System.Runtime.InteropServices.MarshalAsAttribute
Public Sub New (unmanagedType As Short)

参数

unmanagedType
Int16

数据将作为该值封送的值。

注解

此构造函数采用表示每个 UnmanagedType 枚举成员的基础 16 位带符号整数。 Tlbimp.exe (类型库导入程序) 使用此构造函数。

另请参阅

适用于

MarshalAsAttribute(UnmanagedType)

使用指定的 UnmanagedType 枚举成员初始化 MarshalAsAttribute 类的新实例。

public:
 MarshalAsAttribute(System::Runtime::InteropServices::UnmanagedType unmanagedType);
public MarshalAsAttribute (System.Runtime.InteropServices.UnmanagedType unmanagedType);
new System.Runtime.InteropServices.MarshalAsAttribute : System.Runtime.InteropServices.UnmanagedType -> System.Runtime.InteropServices.MarshalAsAttribute
Public Sub New (unmanagedType As UnmanagedType)

参数

unmanagedType
UnmanagedType

数据将作为该值封送的值。

注解

对于容易出错的可读代码,请始终使用此构造函数。

另请参阅

适用于