Rich,
Where the initialization of objects goes from inside - out, the destruction of objects goes from outside -in. The Form destroys itself, then all of its controls. If some of those controls happen to be containers, the container destroys and then its contained objects.
In the code snippet below, what is oObject?
>I have a container control that has in it's Destroy method a call to an object that has a reference to it. When the Form is closed I thought the Destroy method of the container would fire before the form's Destroy. The container object has the following in the Destroy.
>
>oObject.Detach(nUniqueID)
>DODEFAULT()
>
>The Detach method of the oObject then looks up the objects reference using the nUniqueID and then sets it's Object reference to NULL. However, the Destroy code never fires. I even put a WAIT WIND in to see if it fired and it didn't. In the Form's Destroy I can put in the code of THISFORM.oContainer.Detach(nUniqueID) and all works fine. I am trying to write this container control to be able to be dropped onto the form and manage itself.
>
>I wonder if I could instantiate a Timer to release the object?
>
>Any ideas?
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao