IntPtr.Explicit Operator
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
- 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.
public:
static explicit operator IntPtr(void* value);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public static explicit operator IntPtr (void* value);
[System.CLSCompliant(false)]
public static explicit operator IntPtr (void* value);
[<System.CLSCompliant(false)>]
[<System.Security.SecurityCritical>]
static member op_Explicit : nativeptr<unit> -> nativeint
[<System.CLSCompliant(false)>]
static member op_Explicit : nativeptr<unit> -> nativeint
Parameters
- value
- Void*
A pointer to an unspecified type.
Returns
nativeint
A new instance of IntPtr initialized to value
.
- Attributes
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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- 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);
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
nativeint
The signed integer to convert.
Returns
The contents of 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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- 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.
public:
static explicit operator void*(IntPtr value);
[System.CLSCompliant(false)]
public static explicit operator void* (IntPtr value);
[<System.CLSCompliant(false)>]
static member op_Explicit : nativeint -> nativeptr<unit>
Parameters
- value
-
IntPtr
nativeint
The signed integer to convert.
Returns
The contents of value
.
- Attributes
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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- 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);
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
A 64-bit signed integer.
Returns
nativeint
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
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- 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);
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
nativeint
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
.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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- 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);
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
A 32-bit signed integer.
Returns
nativeint
A new instance of IntPtr initialized to 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.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: