Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving a class between class libraries
Message
De
25/05/2001 10:29:37
 
 
À
25/05/2001 09:29:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00511477
Message ID:
00511511
Vues:
24
>Is there a way to programmatically copy or move a class from one class library to another?

Either way, to copy it ADD CLASS.
Be careful here: If this is a class you instantiate with CREATEOBJECT() and you have a copy of the class in two different libraries, and issue SET CLASSLIB for both of them - so they're both in memory - a CREATEOBJECT() will use the one SET first. You can get around this by using NEWOBJECT() instead, which allows you specify the class library.

To move it, after ADD CLASS, REMOVE CLASS from the original library.
Be particularly careful here, because any classes derived from this class or form objects that are instances of this class will lose the reference to the parent class.
The only way, programmatically, to fix these is to hack each VCX (and SCX) containing a derived class or instance of the class and replace the classloc fields for those class or object records.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform