Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form.Destroy()
Message
 
To
05/05/1998 09:37:54
Tim Hockin
Illinois State U - Residential Computing
Normal, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00096885
Message ID:
00097007
Views:
22
>I understand HOW to destroy the elements, and WHY to do so..I don't think I was coherent when I wrote that.
>
>let me try again:
>custom control has n contained objects (all the same, contained in the control, added/manipulated at runtime). I need to force these into a logical order. using container.Controls(index) does not let me reorder the array items. What I am currently doing is when AddObject is called, it also adds a reference to the object in a custom property "Items[]". I can then re-order the elemnts of Items, so I can quickly grab Item 7, without searching potentially the entire controls array.
>
>The problem arises when my form is closed (this control is designed to be re-used) the form.Destroy() method is called, but the control.Destroy() (which NULLs all the values) does NOT, and it hangs. I am looking for some alternative to do this.
>
>Is that clearer? The only alternative I can think of is for me to code EVERY container object.Destroy to do
>
>FOR EACH o IN THIS.Controls
> o.RELEASE()
>ENDFOR
>
>Which is really ugly, and then I can not guarantee that my control can be used outside my own environment.
>

Tim, can you NULL the references in appropriate customControl.object and issue customControl.RemoveObject() from the form method before releasing the form, or I still don't understand what you are trying to do? :)
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform