GCHandle::Alloc Method (Object^, GCHandleType)
Allocates a handle of the specified type for the specified object.
Assembly: mscorlib (in mscorlib.dll)
public: [SecurityCriticalAttribute] static GCHandle Alloc( Object^ value, GCHandleType type )
An instance with nonprimitive (non-blittable) members cannot be pinned.
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1