UnmanagedMarshal.DefineByValArray(Int32) 方法
定义
指定要封送为非托管代码的固定长度的数组 (ByValArray)。Specifies a fixed-length array (ByValArray) to marshal to unmanaged code.
public:
static System::Reflection::Emit::UnmanagedMarshal ^ DefineByValArray(int elemCount);
public static System.Reflection.Emit.UnmanagedMarshal DefineByValArray (int elemCount);
static member DefineByValArray : int -> System.Reflection.Emit.UnmanagedMarshal
Public Shared Function DefineByValArray (elemCount As Integer) As UnmanagedMarshal
参数
- elemCount
- Int32
固定长度数组中的元素数目。The number of elements in the fixed-length array.
返回
一个 UnmanagedMarshal 对象。An UnmanagedMarshal object.
例外
该参数不是简单本机类型。The argument is not a simple native type.
注解
DefineByValArray方法不是简单的本机封送。The DefineByValArray method is not a simple native marshal.
只有非托管封送构造才能使用这些静态构造函数。Only unmanaged marshal constructs can be made using these static constructors.
与封送处理整数参数相比,封送数组是一个更复杂的过程。Marshaling an array is a more complex process than marshaling an integer parameter. 数组成员按特定顺序进行复制,以便另一方可以完全重建数组。Array members are copied in a specific order so that the other side can reconstruct the array exactly.