Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Include file from base class to a derived class
Message
 
 
À
02/06/2006 12:01:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01126779
Message ID:
01126790
Vues:
20
Wei,

include files are not inherited, they are only used compile time. If the derived class needs to use the the constants they have to know where they are found.

I have adopted using an include file for each classlib. This way if the classlib with the derived classes inherit from more than one classlib you can easily account for it:
* parentclasslib1.h
#define XYZ 0

* parentclasslib2.h
#define QWERTY 1

* classlibX.h (which derives from both 1 and 2
#include parentclasslib1.h
#include parentclasslib2.h

#define NewStuffForTheClassesInClasslibX "test"
This way each class that needs to have access to #define constants simply uses its own classlib.h file.

>Thanks. Is there anyway can make it easier? How does VFP implement the derived class?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform