Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why doesn't the container's Destroy method fire?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00390808
Message ID:
00390954
Views:
11
>Larry,
>
>oObject os a Container control. I knew about the Outside In from the docks, but why wouldn't the Destroy event fire prior to the form being completely released?

Looking over your posts again, do I understand it correctly that another object has a reference to the container that is contained in the form. And that the Destroy method of the container attempts to detach itself from the other container.

This won't work. In order for the Destroy events to occur in sequence, nothing can have a reference to that object. If something does have a reference, the Destroy won't fire and consequently, it won't clear itself (Catch-22).

A work around for this would be to add a Release method to your baseclasses. The release method would have Release THIS in the method. Becuase you want to change the behavior of form destruction, add code in the Destroy method of your forms that loops through the Controls collection and explicitly calls the Release method of each of them before the forms destroys itself.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform