Pointer.Box(Void*, Type) 方法

定義

將提供的非管理記憶體指標及其相關類型的 Box 放入一個受管理 Pointer 包裝物件。 值與型別會被儲存,以便在調用時能從原生程式碼存取。

public:
 static System::Object ^ Box(void* ptr, Type ^ type);
public static object Box(void* ptr, Type type);
[System.Security.SecurityCritical]
public static object Box(void* ptr, Type type);
static member Box : nativeptr<unit> * Type -> obj
[<System.Security.SecurityCritical>]
static member Box : nativeptr<unit> * Type -> obj

參數

ptr
Void*

提供的非管理記憶體指標。

type
Type

與參數相關的 ptr 類型。

傳回

一個指標物件。

屬性

例外狀況

type 不是指標。

typenull

適用於