Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IntPtr to GCHandle Conversion

.NET Framework 1.1

A GCHandle is stored using an internal integer representation.

[Visual Basic]
returnValue = GCHandle.op_Explicit(value)
[C#]
public static explicit operator GCHandle(
 IntPtr value
);
[C++]
public: static GCHandle op_Explicit(
 IntPtr value
);
[JScript]
returnValue = GCHandle(value);

[Visual Basic] In Visual Basic, you can use the conversion operators defined by a type, but you cannot define your own.

[JScript] In JScript, you can use the conversion operators defined by a type, but you cannot define your own.

Arguments [Visual Basic, JScript]

value
An IntPtr that indicates the handle for which the conversion is required.

Parameters [C#, C++]

value
An IntPtr that indicates the handle for which the conversion is required.

Return Value

The GCHandle.

Remarks

This method allows you to retrieve a GCHandle from an integer value.

Requirements

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

.NET Framework Security: 

See Also

GCHandle Structure | GCHandle Members | System.Runtime.InteropServices Namespace | GCHandleType

Show:
© 2015 Microsoft