Redigera

Dela via


WeakGCHandle<T>.FromIntPtr(IntPtr) Method

Definition

Returns a new WeakGCHandle<T> object created from a handle to a managed object.

public:
 static System::Runtime::InteropServices::WeakGCHandle<T> FromIntPtr(IntPtr value);
public static System.Runtime.InteropServices.WeakGCHandle<T> FromIntPtr(IntPtr value);
static member FromIntPtr : nativeint -> System.Runtime.InteropServices.WeakGCHandle<'T (requires 'T : null)>
Public Shared Function FromIntPtr (value As IntPtr) As WeakGCHandle(Of T)

Parameters

value
IntPtr

nativeint

An IntPtr handle to a managed object to create a WeakGCHandle<T> object from.

Returns

A new WeakGCHandle<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 WeakGCHandle<T> is not interchangable with GCHandle.

Applies to