Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get rid of a child object in a class at runtime
Message
 
To
13/08/2002 09:23:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00688718
Message ID:
00689234
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform