Hi
In addition to Scott's suggestion, you may try to add the reference to the
object in the hashtable, so that the three reference will pointed to one
object.
e.g.
Public Class Test
Public i As Integer
End Class
Module Module1
Sub Main()
Dim o As New Test
Dim a As Test
Dim b As Test
a = o
b = o
Dim ht As New Hashtable
ht.Add("A", a)
ht.Add("B", b)
ht.Add("C", o)
Console.WriteLine(CType(ht("A"), Test).i)
Console.WriteLine(CType(ht("B"), Test).i)
Console.WriteLine(CType(ht("C"), Test).i)
o.i += 1
Console.WriteLine(CType(ht("A"), Test).i)
Console.WriteLine(CType(ht("B"), Test).i)
Console.WriteLine(CType(ht("C"), Test).i)
End Sub
End Module
You may have a try.
Best regards,
Perter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.