Citiți în limba engleză Editare

Partajați prin


IntPtr.Explicit Operator

Definition

Converts a specified data type to an IntPtr value, or an IntPtr value to a specified data type.

Overloads

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)

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

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)

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

Explicit(IntPtr to Int32)

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

Explicit(Int32 to IntPtr)

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

Explicit(Void* to IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

Important

This API is not CLS-compliant.

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

This API is not CLS-compliant.

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

Parameters

value
Void*

A pointer to an unspecified type.

Returns

IntPtr

A new instance of IntPtr initialized to value.

Attributes

See also

Applies to

Explicit(IntPtr to Int64)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

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

public static explicit operator long(IntPtr value);

Parameters

value
IntPtr

The signed integer to convert.

Returns

The contents of value.

See also

Applies to

Explicit(IntPtr to Void*)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

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.

[System.CLSCompliant(false)]
public static explicit operator void*(IntPtr value);

Parameters

value
IntPtr

The signed integer to convert.

Returns

Void*

The contents of value.

Attributes

See also

Applies to

Explicit(Int64 to IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

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

public static explicit operator IntPtr(long value);

Parameters

value
Int64

A 64-bit signed integer.

Returns

IntPtr

A new instance of IntPtr initialized to value.

Exceptions

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

See also

Applies to

Explicit(IntPtr to Int32)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

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

public static explicit operator int(IntPtr value);

Parameters

value
IntPtr

The signed 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 signed integer.

Remarks

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

See also

Applies to

Explicit(Int32 to IntPtr)

Source:
IntPtr.cs
Source:
IntPtr.cs
Source:
IntPtr.cs

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

public static explicit operator IntPtr(int value);

Parameters

value
Int32

A 32-bit signed integer.

Returns

IntPtr

A new instance of IntPtr initialized to value.

See also

Applies to