[CLSCompliant(false)] |
The UIntPtr type can be used by languages that support pointers, and as a common means of referring to data between languages that do and do not support pointers. UIntPtr objects can also be used to hold handles.
The IntPtr type is CLS-compliant, while the UIntPtr type is not. Only the IntPtr type is used in the common language runtime. The UIntPtr type is provided mostly to maintain architectural symmetry with the IntPtr type.
This type implements the ISerializable interface.
ctor #1 | Overloaded:.ctor(uint value) Initializes a new instance of the UIntPtr structure using the specified 32-bit pointer or handle. |
ctor #2 | Overloaded:.ctor(ulong value) Initializes a new instance of UIntPtr using the specified 64-bit pointer or handle. |
ctor #3 | Overloaded:.ctor(void* value) Initializes a new instance of UIntPtr using the specified pointer to an unspecified type. |
Zero | A read-only field that represents a pointer or handle that has been initialized to zero. |
Size | Read-only Gets the size of this instance. |
Equals | Overridden: Returns a value indicating whether this instance is equal to a specified object. |
GetHashCode | Overridden: Returns the hash code for this instance. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
ToPointer | Converts the value of this instance to a pointer to an unspecified type. |
ToString | Overridden: Converts the numeric value of this instance to its equivalent string representation. |
ToUInt32 | Converts the value of this instance to a 32-bit unsigned integer. |
ToUInt64 | Converts the value of this instance to a 64-bit unsigned integer. |
op_Equality | Determines whether two specified instances of UIntPtr are equal. |
op_Explicit (convert System.UInt32 to System.UIntPtr) |
Overloaded:op_Explicit(uint value) Converts the value of a 32-bit unsigned integer to an UIntPtr. |
op_Explicit (convert System.UInt64 to System.UIntPtr) |
Overloaded:op_Explicit(ulong value) Converts the value of a 64-bit unsigned integer to an UIntPtr. |
op_Explicit (convert System.UIntPtr to System.Void*) |
Overloaded:op_Explicit(UIntPtr value) Converts the value of the specified UIntPtr to a pointer to an unspecified type. |
op_Explicit (convert System.UIntPtr to System.UInt64) |
Overloaded:op_Explicit(UIntPtr value) Converts the value of the specified UIntPtr to a 64-bit unsigned integer. |
op_Explicit (convert System.UIntPtr to System.UInt32) |
Overloaded:op_Explicit(UIntPtr value) Converts the value of the specified UIntPtr to a 32-bit unsigned integer. |
op_Explicit (convert System.Void* to System.UIntPtr) |
Overloaded:op_Explicit(void* value) Converts the specified pointer to an unspecified type to a UIntPtr. |
op_Inequality | Determines whether two specified instances of UIntPtr are not equal. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public UIntPtr( |
value
public UIntPtr( |
value
Exception Type | Condition |
---|---|
OverflowException | On a 32-bit platform, value is too large to represent as an UIntPtr. |
[CLSCompliant(false)] |
value
public static readonly UIntPtr Zero;
|
For example, assume the variable, uip, is an instance of UIntPtr. You can determine if it has been set by comparing it to the value returned by a constructor, for example: "
if uip != new
UIntPtr(0)...
". However, invoking a constructor to get an unintialized pointer is inefficient. It is better to code either "
if uip != UIntPtr.Zero...
", or "
if
!UIntPtr.Zero.Equals(uip)...
".
public static int Size {get;}
|
obj
~UIntPtr(); |
public override int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
value1
value2
value
value
Exception Type | Condition |
---|---|
OverflowException | On a 32-bit platform, value is too large to represent as an UIntPtr. |
value
value
value
Exception Type | Condition |
---|---|
OverflowException | On a 64-bit platform, the value of value is too large to represent as a 32-bit unsigned integer. |
value
value1
value2
[CLSCompliant(false)] |
public override string ToString(); |
public uint ToUInt32(); |
Exception Type | Condition |
---|---|
OverflowException | On a 64-bit platform, the value of this instance is too large to represent as a 32-bit unsigned integer. |
public ulong ToUInt64(); |