'-------------------------------------------------------------------- ' Test case of GCHandle Class '-------------------------------------------------------------------- Namespace GCHandleTest Sub TestMain() Dim o = New Object Dim gch = System.Runtime.InteropServices.GCHandle.Alloc(o) UnitTest("GCHandle.Alloc, Target", o.Equals(gch.Target)) Dim ip = System.Runtime.InteropServices.GCHandle.ToIntPtr(gch) gch = Nothing gch = System.Runtime.InteropServices.GCHandle.FromIntPtr(ip) UnitTest("GCHandle - IntPtr", o.Equals(gch.Target)) End Sub End Namespace GCHandleTest.TestMain()