語言

GCHandle<T>.FromIntPtr(IntPtr) 方法

定義

將從一個句柄建立的新物件回傳 GCHandle<T> 給一個受管理物件。

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)

參數

value
IntPtr

nativeint

一個 IntPtr 管理物件的 handle 來建立 GCHandle<T> 物件。

傳回

一個對 GCHandle<T> 應於值參數的新物件。

備註

此方法不會驗證所提供的 handle 值。 呼叫者必須確保該句柄的有效性。

IntPtr的GCHandle<T>表示與 不可互換GCHandle。

適用於