Edit

Share via


GCHandle<T>.FromIntPtr(IntPtr) Method

Definition

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.

Applies to