Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hack VCX to add custom properties
Message
De
24/05/2008 07:31:19
 
 
À
23/05/2008 20:44:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01319311
Message ID:
01319335
Vues:
17
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform