Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing a parent's object
Message
 
 
À
27/08/2007 18:26:18
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01250681
Message ID:
01250806
Vues:
14
>>>I obviously did not understand the "reference" part of all that. I wish I understood why this doesn't work.
>>
>>Ok, I'll try one more time.
>>
>>When you add an object to the form (or any container object), the object now have an access to the form and its methods/properties.
>>
>>If you add a reference to the object created with createobject syntax, this object doesn't know the object it's being added as a reference to and thus can not access that object methods/properties.
>>
>>So, you would have to somehow save the "parent" object inside this "child" object (Hugo's idea) , but it may easily lead to dangling references and other bad things.
>
>I didn't see your other post before I read this one. Making more sense, but not sure how I'm going to handle this. This seems like such a simple functionality that I want that I can't believe that it's this difficult to do.

You want to access properties and functionality of an object which is not related to your other object. Moreover, you want to access this functionality from the object which has this object as a reference. It goes against OOP principles and I really don't see a way around it, though I'm very tired and upset right now, can not think straight. May be Hugo or Rich have a better idea.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform