Export (0) Print
Expand All

UIntPtr Structure

A platform-specific type that is used to represent a pointer or a handle.

This API is not CLS-compliant. 

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
<ComVisibleAttribute(True)> _
<CLSCompliantAttribute(False)> _
Public Structure UIntPtr

The UIntPtr type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360UIntPtr(UInt32)Initializes a new instance of the UIntPtr structure using the specified 32-bit pointer or handle.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360UIntPtr(UInt64)Initializes a new instance of UIntPtr using the specified 64-bit pointer or handle.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360UIntPtr(Void*)Initializes a new instance of UIntPtr using the specified pointer to an unspecified type.
Top

  NameDescription
Public propertyStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360SizeGets the size of this instance.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360EqualsReturns a value indicating whether this instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360FinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetHashCodeReturns the hash code for this instance. (Overrides ValueType.GetHashCode.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360MemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ToPointerConverts the value of this instance to a pointer to an unspecified type.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ToStringConverts the numeric value of this instance to its equivalent string representation. (Overrides ValueType.ToString.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ToUInt32Converts the value of this instance to a 32-bit unsigned integer.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ToUInt64Converts the value of this instance to a 64-bit unsigned integer.
Top

  NameDescription
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360EqualityDetermines whether two specified instances of UIntPtr are equal.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Narrowing(UInt32 to UIntPtr)Converts the value of a 32-bit unsigned integer to an UIntPtr.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Narrowing(UInt64 to UIntPtr)Converts the value of a 64-bit unsigned integer to an UIntPtr.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Narrowing(UIntPtr to UInt32)Converts the value of the specified UIntPtr to a 32-bit unsigned integer.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Narrowing(UIntPtr to UInt64)Converts the value of the specified UIntPtr to a 64-bit unsigned integer.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Narrowing(UIntPtr to Void*)Converts the value of the specified UIntPtr to a pointer to an unspecified type.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360Narrowing(Void* to UIntPtr)Converts the specified pointer to an unspecified type to a UIntPtr.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360InequalityDetermines whether two specified instances of UIntPtr are not equal.
Top

  NameDescription
Public fieldStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360ZeroA read-only field that represents a pointer or handle that has been initialized to zero.
Top

The UIntPtr type is designed to be an integer whose size is platform-specific. That is, an instance of this type is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit hardware and operating systems.

Important noteImportant Note:

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.

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.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

This type is thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft