I have a class containing a method which wants to store the current object (me) in a collection. It would be great to just say "myvariant = me", etc. But the compiler says no.
I can clone the current object by creating a new instance and copying each instance variable from the current object to it. But then I have effectively two definitions of the interface, one in the class declarations and the other in my cloning method, which is at the mercy of my coding and maintenance skills.
Is there an alternative way of grabbing the entire current object into a variant?
this might work
Local o As IUnknown
Local v As Variant
o = Me
v = o
Thanks Stan, that works!