Hi
Does anyone know how to run code in a VB6 class that is executed when an object is set to Nothing (i.e. when the reference count is decremented)
Class_Terminate is run when the object is destroyed (i.e. reference count is equal to 0) but this is not the case when the object is in a hierarcy with a reference to a parent object.
Any clues? At the moment I am handling this by having a dispose method which must be called prior to setting the property to Nothing but I'd rather have this code run automatically as it can leave objects hanging around in memory if the dispose method is not called.
Chaz
Does anyone know how to run code in a VB6 class that is executed when an object is set to Nothing (i.e. when the reference count is decremented)
Class_Terminate is run when the object is destroyed (i.e. reference count is equal to 0) but this is not the case when the object is in a hierarcy with a reference to a parent object.
Any clues? At the moment I am handling this by having a dispose method which must be called prior to setting the property to Nothing but I'd rather have this code run automatically as it can leave objects hanging around in memory if the dispose method is not called.
Chaz