The methods of the GCHandle structure are listed below. For a complete list of GCHandle structure members, see the GCHandle Members topic.
AddrOfPinnedObject | Retrieve the address of an object in a Pinned handle. |
Alloc | Overloaded. Allocates a Normal handle for the object specified. A normal handle ensures the object will not be collected by the garbage collector and is more space and performance efficient than the two weak handles described in GCHandleType. |
Equals (inherited from ValueType) | Indicates whether this instance and another object are equal. |
Free | Frees a GC handle. The caller must provide synchronization to prevent multiple threads from executing this call simultaneously for a given handle. |
GetHashCode (inherited from ValueType) | Returns the hash code for this instance. |
GetType (inherited from Object) | Gets the Type of the Object. |
ToString (inherited from ValueType) | Returns the name of the type. |
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by the Garbage Collector (GC). This method may be ignored by the runtime; therefore, necessary cleanup operations should be done elsewhere. |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object. |
GCHandle Structure | System.Runtime.InteropServices Namespace