This documentation is archived and is not being maintained.

UIntPtr.ToUInt32 Method

Converts the value of this instance to a 32-bit unsigned integer.

The UIntPtr type is not CLS-compliant. The CLS-compliant alternative type is IntPtr. For more information about CLS compliance, see What is the Common Language Specification.

[Visual Basic]
Public Function ToUInt32() As UInt32
public uint ToUInt32();
public: unsigned int ToUInt32();
public function ToUInt32() : UInt32;

Return Value

A 32-bit unsigned integer equal to the value of this instance.


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.


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


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

UIntPtr Structure | UIntPtr Members | System Namespace