Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sub-classing on-the-fly
Message
 
À
20/05/2003 17:26:53
Chad Ashpole
Ads Information Systems, Inc.
Minneapolis, Minnesota, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00790770
Message ID:
00790806
Vues:
16
Chad,

Executables should ALWAYS contain the parent class for any sub-class. I've spent much time developing multi-executable applications and experimenting. You can break this rule by using the SET CLASSLIB or SET PROCEDURE in your MasterApp before instantiating the sub-class in MyApp. The advantage of using multiple executables and the NEWOBJECT function is class encapsulation and component distribution. Your approach breaks encapsulation and I wouldn’t recommend it.

>I have created a FoxPro v6.0 program (i'll call it myapp) that runs inside another FoxPro v6.0 program (i'll call it masterapp). The masterapp has a number of class libraries (.vcx) compiled into the .exe. Myapp sub-classes these class libraries to create my sub-classed objects. This has all been done in my VFP project. In order to get my sub-classed objects on one of the masterapp's forms, I have to compile the masterapp's class libraries in with myapp when I build the app. I do not want to have to do this.
>
>Since the masterapp's class libraries are compiled into the .exe, is there a way I can sub-class on the fly. I have tried to write a procedure to do this: DEFINE CLASS myobj as masterobj... However, when I try to add one of my sub-classed objects to a form I receive an "Error instantiating class" error. I appologize if this is confusing, if anyone reads this and can help it would be much appreciated. Basically what I am getting at is I do not want to send the masterapp's class libraries out with myapp.
Heavy Metal Pedal - click with care
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform