Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NEWOBJECT() Has no parent.
Message
From
27/06/2000 13:44:16
 
 
To
26/06/2000 18:06:27
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00384767
Message ID:
00385243
Views:
29
>David,
>
>What do you do about a class that's not a container class, and doesn't have an addobject method? I ran into a similar problem a while back - I created a sizing object which automatically handles resizing of any object which has a reference to it when it or it's container is resized. In order to do it, I had to pass the "parent" class' object reference to the resize object. To solve the dangling reference problem, I use the same name for this object in all my classes, and in all my base container classes, I created a "custom event" which triggers all the cotained classes to kill the autoresize object reference.
>
>Sounds complicated, and it was, but now that it works in all my baseclasses, I never have to worry about it. Is there a better way to do that?

A better way to do it would be to reverse the object references from the way that you had them: make your resizer object hold a reference to all objects that it is responsible for resizing. You can do this with a home-built controls array.

There is no built in method to retreive a reference to all objects that reference a given object.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform