Pointer.Box(Void*, Type) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Boxes the supplied unmanaged memory pointer and the type associated with that pointer into a managed Pointer wrapper object. The value and the type are saved so they can be accessed from the native code during an invocation.
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
Parameters
- ptr
- Void*
The supplied unmanaged memory pointer.
- type
- Type
The type associated with the ptr
parameter.
Returns
A pointer object.
- Attributes
Exceptions
type
is not a pointer.
type
is null
.
Applies to
Співпраця з нами на GitHub
Джерело цього вмісту можна знайти на GitHub, де також можна створювати й переглядати запитання та запити на внесення змін. Докладні відомості наведено в нашому посібнику для співавторів.