GCHandle.Explicit Operator

Definition

Converts the value of a GCHandle object to another type.

Overloads

Explicit(IntPtr to GCHandle)

A GCHandle is stored using an internal integer representation.

Explicit(GCHandle to IntPtr)

A GCHandle is stored using an internal integer representation.

Explicit(IntPtr to GCHandle)

Source:
GCHandle.cs
Source:
GCHandle.cs
Source:
GCHandle.cs

A GCHandle is stored using an internal integer representation.

C#
[System.Security.SecurityCritical]
public static explicit operator System.Runtime.InteropServices.GCHandle(IntPtr value);
C#
public static explicit operator System.Runtime.InteropServices.GCHandle(IntPtr value);

Parameters

value
IntPtr

An IntPtr that indicates the handle for which the conversion is required.

Returns

The stored GCHandle object using an internal integer representation.

Attributes

Remarks

This method allows you to retrieve a GCHandle from an integer value.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

Explicit(GCHandle to IntPtr)

Source:
GCHandle.cs
Source:
GCHandle.cs
Source:
GCHandle.cs

A GCHandle is stored using an internal integer representation.

C#
public static explicit operator IntPtr(System.Runtime.InteropServices.GCHandle value);

Parameters

value
GCHandle

The GCHandle for which the integer is required.

Returns

IntPtr

The integer value.

Remarks

This method can be used to retrieve the integer value from a GCHandle.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0