Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get rid of a child object in a class at runtime
Message
 
À
13/08/2002 09:23:30
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00688718
Message ID:
00689234
Vues:
20
Hi Dragan,

you're always coming from the back with those cool ideas :)

I really like that approach, but unfortunately the access method doesn't fire :(

Thanks,
Armin

>>Hi,
>>
>>I have a framework container class which hosts another object as a child. I would like to replace the child object with my own. The problem is, my object should have the same name as the original object, so the code in the container class that references the child object is not broken.
>>
>>I know that I can't remove or rename the child object in design mode, so I wanted to do that at runtime. Does anyone see a chance to get rid or to rename the original object at runtime?
>
>After having read the whole thread... I think I may have something:
>
>- subclass the container
>- add oObject_access method to the container, like this:
>
>
if type("this.oReplacement.name")#"C"
>   this.addobject( --- add your new object here)
>endif
>return this.oReplacement
>
>The whole idea is to redirect anything that mentions the object you want removed, to the cuckoo's egg you want to show up instead.

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform