I'm using VFP 7.0
I'm trying to create a class that lets me add an object to any control, without putting any coding in the control except the 1 line to create the object.
SomeControl.Init()
createobject( 'myClass', this )
define class myClass as custom
procedure init()
lparameters toControl
this.oControl = toControl
with this.oControl
.parent.addobject( 'somename', 'myObject', this )
.....
endwith
procedure destroy()
with this.oControl
.....
endwith
this.oControl = .null.
Specifically I want to make sure that I'm correct in my assumptions before I start creating this class.
This would be the sequence of events that interest me:
1. SomeControl.parent.destroy() - automatically releases 'myObject'
2. myObject.destroy() - can still reference SomeControl's properties.
3. myObject.destroy() - then removes the reference to SomeControl.
4. SomeControl.destroy() - has no extra instances, so should have no problem releasing.
Am I correct in my assumtion that SomControl.parent.destroy() would trigger myObject.destroy() before SomeControl.destroy()?
Bill Morris