Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hack VCX to add custom properties
Message
From
24/05/2008 07:31:19
 
 
To
23/05/2008 20:44:07
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01319311
Message ID:
01319335
Views:
16
>Is there some simple way to hack a VCX to add custom properties to a number of the classes defined there?

I would not hack the vcx as data. Also you would normally add properties to a base class only.

Travers a project with for each loFile in _vfp.Activeproject.Files. Check for files of type classlib (loFile.Type="V"), Use AVCXCLASSES() to get a list of classes of a vcx file (loFile.name). Use ACLASSES() to find ancestors/parent classes of a class.

When you found the root classes

MODIFY class xyz of some.vcx nowait
ASELOBJ(laXYZ)
loXYZ=laXYZ(1)
loXYZ.AddProperty("newproperty")
..

You may previously check if a property already exists with AMEMBERS(). It's all there, you don't need to hack data.

Bye, Olaf.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform