IntPtr.Explicit IntPtr.Explicit IntPtr.Explicit IntPtr.Explicit Operator

Definition

Overloads

Explicit(Void* to IntPtr) Explicit(Void* to IntPtr) Explicit(Void* to IntPtr)

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

This API is not CLS-compliant.

Explicit(IntPtr to Int64) Explicit(IntPtr to Int64) Explicit(IntPtr to Int64) Explicit(IntPtr to Int64)

Converts the value of the specified IntPtr to a 64-bit signed integer.

Explicit(IntPtr to Void*) Explicit(IntPtr to Void*) Explicit(IntPtr to Void*)

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

This API is not CLS-compliant.

Explicit(Int64 to IntPtr) Explicit(Int64 to IntPtr) Explicit(Int64 to IntPtr) Explicit(Int64 to IntPtr)

Converts the value of a 64-bit signed integer to an IntPtr.

Explicit(Int32 to IntPtr) Explicit(Int32 to IntPtr) Explicit(Int32 to IntPtr) Explicit(Int32 to IntPtr)

Converts the value of a 32-bit signed integer to an IntPtr.

Explicit(IntPtr to Int32) Explicit(IntPtr to Int32) Explicit(IntPtr to Int32) Explicit(IntPtr to Int32)

Converts the value of the specified IntPtr to a 32-bit signed integer.

Explicit(Void* to IntPtr) Explicit(Void* to IntPtr) Explicit(Void* to IntPtr)

Important

This API is not CLS-compliant.

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

This API is not CLS-compliant.

public:
 static explicit operator IntPtr(void* value);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public static explicit operator IntPtr (void* value);
static member op_Explicit : nativeptr<unit> -> nativeint

Parameters

value
Void*

A pointer to an unspecified type.

Returns

A new instance of IntPtr initialized to value.

Security

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Explicit(IntPtr to Int64) Explicit(IntPtr to Int64) Explicit(IntPtr to Int64) Explicit(IntPtr to Int64)

Converts the value of the specified IntPtr to a 64-bit signed integer.

public:
 static explicit operator long(IntPtr value);
public static explicit operator long (IntPtr value);
static member op_Explicit : nativeint -> int64
Public Shared Narrowing Operator CType (value As IntPtr) As Long

Parameters

value
IntPtr IntPtr IntPtr IntPtr

The pointer or handle to convert.

Returns

The contents of value.

See also

Explicit(IntPtr to Void*) Explicit(IntPtr to Void*) Explicit(IntPtr to Void*)

Important

This API is not CLS-compliant.

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

This API is not CLS-compliant.

public:
 static explicit operator void*(IntPtr value);
[System.CLSCompliant(false)]
public static explicit operator void* (IntPtr value);
static member op_Explicit : nativeint -> nativeptr<unit>

Parameters

value
IntPtr IntPtr IntPtr IntPtr

The pointer or handle to convert.

Returns

Void*

The contents of value.

See also

Explicit(Int64 to IntPtr) Explicit(Int64 to IntPtr) Explicit(Int64 to IntPtr) Explicit(Int64 to IntPtr)

Converts the value of a 64-bit signed integer to an IntPtr.

public:
 static explicit operator IntPtr(long value);
public static explicit operator IntPtr (long value);
static member op_Explicit : int64 -> nativeint
Public Shared Narrowing Operator CType (value As Long) As IntPtr

Parameters

value
Int64 Int64 Int64 Int64

A 64-bit signed integer.

Returns

A new instance of IntPtr initialized to value.

Exceptions

On a 32-bit platform, value is too large to represent as an IntPtr.

Explicit(Int32 to IntPtr) Explicit(Int32 to IntPtr) Explicit(Int32 to IntPtr) Explicit(Int32 to IntPtr)

Converts the value of a 32-bit signed integer to an IntPtr.

public:
 static explicit operator IntPtr(int value);
public static explicit operator IntPtr (int value);
static member op_Explicit : int -> nativeint
Public Shared Narrowing Operator CType (value As Integer) As IntPtr

Parameters

value
Int32 Int32 Int32 Int32

A 32-bit signed integer.

Returns

A new instance of IntPtr initialized to value.

Explicit(IntPtr to Int32) Explicit(IntPtr to Int32) Explicit(IntPtr to Int32) Explicit(IntPtr to Int32)

Converts the value of the specified IntPtr to a 32-bit signed integer.

public:
 static explicit operator int(IntPtr value);
public static explicit operator int (IntPtr value);
static member op_Explicit : nativeint -> int
Public Shared Narrowing Operator CType (value As IntPtr) As Integer

Parameters

value
IntPtr IntPtr IntPtr IntPtr

The pointer or handle to convert.

Returns

The contents of value.

Exceptions

On a 64-bit platform, the value of value is too large to represent as a 32-bit signed integer.

Remarks

An exception is only thrown if the value of value requires more bits than the current platform supports.

See also

Applies to