MarshalAsAttribute.SafeArraySubType 字段

定义

指示 SafeArray 的元素类型。Indicates the element type of the SafeArray.

public: System::Runtime::InteropServices::VarEnum SafeArraySubType;
public System.Runtime.InteropServices.VarEnum SafeArraySubType;
val mutable SafeArraySubType : System.Runtime.InteropServices.VarEnum
Public SafeArraySubType As VarEnum 

字段值

注解

可以将此字段设置为 System.Runtime.InteropServices.VarEnum 枚举中的一个值,以指定安全数组的元素的类型。You can set this field to a value from the System.Runtime.InteropServices.VarEnum enumeration to specify the type of the safe array's elements. 如果未指定类型,则使用托管元素类型的默认类型(如果传递为变体)。If a type is not specified, the managed element type's default type (if passed as a VARIANT) is used. 例如,COM 中 int 数组的 SafeArraySubType VT_I4For example, the SafeArraySubType for an int array in COM is VT_I4. 有关其他信息,请参阅数组的默认封送处理For additional information, see Default Marshaling for Arrays.

适用于

另请参阅