Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I change object's parent class?
Message
De
28/05/2002 18:01:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00658367
Message ID:
00662204
Vues:
31
>Inge,
>
>>I really messed up my project. I have 2 copy of the same class library in 2 different folders. Accidently, I have added objects into my form, from both classes (which I should not have done. I was suppose to only use 1 of the class library). I think this is why when I compiled my codes, the application does not run at all. It gives me a 'class name is invalid' error. I've checked my objects (in my form class) & have found some objects has the wrong parent class (class name is the same, but it is from a different folder). I've tried looking into the class browser, & there I can check parent classes of my objects, but I don't know if I can just change the parent class to the correct pathname (file name of the classlib is the same). Can anybody help???? Thank you all!!!
>
>Rename the folder where the "wrong" classlib resides or move the classlib
>temporarily to another folder.
>Open the form with modi form or from within the project-manager. You will get
>error-messages with the option "search". locate the correct class and save!
>the form. After that Your form should always look for the correct class.
>Now You can move the wrong classlib back to the place it belongs. Remove wrong the classlib from the project-manager as it will not go away by itself.
>
>Just in case: make a backup of Your form before You do this.
>
>HTH

Another solution, which has the same effect as the solution above, but does not require you to rename or move any directories, is to USE the SCX file for your form, locate the records pertaining to the "wrong" class library (see CLASSLOC field) and change the references to the "correct" library. Close the SCX file and your good to go. In the interest of tidiness you'll still need to remove the library from your project if you are no longer using it elsewhere in another form, etc.
"The most beautiful experience we can have is the mysterious ; it is the fundamental emotion which stands at the cradle of true art and true science." - Albert Einstein
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform