Hi Lance,
I agree with Armin's suggestion. When we pass an object, we will not know
what class the object belong to, we have to do it ourself.
For a workaroud, You may try to pass the TestABC object in the meantime, so
that we know that.
e.g.
[TestCls]
Public Class TestABC
Public tls As ArrayList
Public tls2 As ArrayList
Public Shared Function Hello() As String
Return "Hello World"
End Function
End Class
[Module1.vb]
Dim o As New TestCls.TestABC
o.tls2 = New ArrayList
Dim c As Object
c = o.tls2
Console.WriteLine(o.GetType().ToString)
For Each b As System.Reflection.FieldInfo In o.GetType().GetFields()
If Object.ReferenceEquals(c, b.GetValue(o)) Then
Console.WriteLine(b.Name)
End If
Next
Console.WriteLine(o.Hello)
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.