G
Guest
i need to know if i can have a pointer to a pointer in VB.NET
given
Class CClass
'declarations
End Class
and then
Sub MySub()
Dim MyClass as CClass
End Sub
MyClass is a 'pointer' to a CClass object.
what i need is a pointer to a pointer...
my problem is that if i do this
Dim MyClassA as CClass
Dim MyClassB as CClass
MyClassA = Object1
MyClassB = MyClassA
it simply copies the address that MyClassA refers to, to MyClassB
i want MyClassB to point to the address of MyClassA if possible
this way whenever i repoint MyClassA at something new, MyClassB will point
at the same new object. the way it is above, if i reasign MyClassA to a new
object, MyClassB will still point at the first object. this is really easy to
do in C/C++...
heres something like what it could look like:
Dim MyClassA as CClass
Dim MyClassB as CClassPointer
MyClassA = Object1
MyClassB = MyClassA 'MyClassB points at MyClassA, instead of pointing at
what MyClassA points at
MyClassA = Object2 'now both MyClassA, and MyClassB point at the new object
given
Class CClass
'declarations
End Class
and then
Sub MySub()
Dim MyClass as CClass
End Sub
MyClass is a 'pointer' to a CClass object.
what i need is a pointer to a pointer...
my problem is that if i do this
Dim MyClassA as CClass
Dim MyClassB as CClass
MyClassA = Object1
MyClassB = MyClassA
it simply copies the address that MyClassA refers to, to MyClassB
i want MyClassB to point to the address of MyClassA if possible
this way whenever i repoint MyClassA at something new, MyClassB will point
at the same new object. the way it is above, if i reasign MyClassA to a new
object, MyClassB will still point at the first object. this is really easy to
do in C/C++...
heres something like what it could look like:
Dim MyClassA as CClass
Dim MyClassB as CClassPointer
MyClassA = Object1
MyClassB = MyClassA 'MyClassB points at MyClassA, instead of pointing at
what MyClassA points at
MyClassA = Object2 'now both MyClassA, and MyClassB point at the new object