GCHandle<T>.FromIntPtr(IntPtr) 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.
Returns a new GCHandle<T> object created from a handle to a managed object.
public:
static System::Runtime::InteropServices::GCHandle<T> FromIntPtr(IntPtr value);
public static System.Runtime.InteropServices.GCHandle<T> FromIntPtr(IntPtr value);
static member FromIntPtr : nativeint -> System.Runtime.InteropServices.GCHandle<'T (requires 'T : null)>
Public Shared Function FromIntPtr (value As IntPtr) As GCHandle(Of T)
Parameters
- value
-
IntPtr
nativeint
An IntPtr handle to a managed object to create a GCHandle<T> object from.
Returns
A new GCHandle<T> object that corresponds to the value parameter.
Remarks
This method doesn't validate the provided handle value. The caller must ensure the validity of the handle.
The IntPtr representation of GCHandle<T> is not interchangable with GCHandle.