UIntPtr.Explicit Operator

Definition

Overloads

Explicit(UInt32 to UIntPtr)

Converts the value of a 32-bit unsigned integer to an UIntPtr.

Explicit(UInt64 to UIntPtr)

Converts the value of a 64-bit unsigned integer to an UIntPtr.

Explicit(UIntPtr to UInt32)

Converts the value of the specified UIntPtr to a 32-bit unsigned integer.

Explicit(UIntPtr to UInt64)

Converts the value of the specified UIntPtr to a 64-bit unsigned integer.

Explicit(UIntPtr to Void*)

Converts the value of the specified UIntPtr to a pointer to an unspecified type.

This API is not CLS-compliant.

Explicit(Void* to UIntPtr)

Converts the specified pointer to an unspecified type to an UIntPtr.

This API is not CLS-compliant.

Explicit(UInt32 to UIntPtr)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Converts the value of a 32-bit unsigned integer to an UIntPtr.

C#
public static explicit operator UIntPtr(uint value);

Parameters

value
UInt32

A 32-bit unsigned integer.

Returns

UIntPtr

A new instance of UIntPtr initialized to value.

See also

Applies to

.NET 10 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, 10
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

Explicit(UInt64 to UIntPtr)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Converts the value of a 64-bit unsigned integer to an UIntPtr.

C#
public static explicit operator UIntPtr(ulong value);

Parameters

value
UInt64

A 64-bit unsigned integer.

Returns

UIntPtr

A new instance of UIntPtr initialized to value.

Exceptions

In a 32-bit process, value is too large to represent as an UIntPtr.

See also

Applies to

.NET 10 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, 10
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

Explicit(UIntPtr to UInt32)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Converts the value of the specified UIntPtr to a 32-bit unsigned integer.

C#
public static explicit operator uint(UIntPtr value);

Parameters

value
UIntPtr

The unsigned integer to convert.

Returns

The contents of value.

Exceptions

In a 64-bit process, the value of value is too large to represent as a 32-bit unsigned integer.

Remarks

An exception is only thrown if the value of value requires more bits than the executing process supports.

See also

Applies to

.NET 10 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, 10
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

Explicit(UIntPtr to UInt64)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Converts the value of the specified UIntPtr to a 64-bit unsigned integer.

C#
public static explicit operator ulong(UIntPtr value);

Parameters

value
UIntPtr

The unsigned integer to convert.

Returns

The contents of value.

See also

Applies to

.NET 10 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, 10
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

Explicit(UIntPtr to Void*)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Important

This API is not CLS-compliant.

Converts the value of the specified UIntPtr to a pointer to an unspecified type.

This API is not CLS-compliant.

C#
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public static explicit operator void*(UIntPtr value);
C#
public static explicit operator void*(UIntPtr value);
C#
[System.CLSCompliant(false)]
public static explicit operator void*(UIntPtr value);

Parameters

value
UIntPtr

The unsigned integer to convert.

Returns

Void*

The contents of value.

Attributes

See also

Applies to

.NET 10 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, 10
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

Explicit(Void* to UIntPtr)

Source:
UIntPtr.cs
Source:
UIntPtr.cs
Source:
UIntPtr.cs

Important

This API is not CLS-compliant.

Converts the specified pointer to an unspecified type to an UIntPtr.

This API is not CLS-compliant.

C#
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public static explicit operator UIntPtr(void* value);
C#
public static explicit operator UIntPtr(void* value);
C#
[System.CLSCompliant(false)]
public static explicit operator UIntPtr(void* value);

Parameters

value
Void*

A pointer to an unspecified type.

Returns

UIntPtr

A new instance of UIntPtr initialized to value.

Attributes

See also

Applies to

.NET 10 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, 10
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0