Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#INCLUDE question
Message
 
 
À
13/07/2003 15:28:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00809686
Message ID:
00809687
Vues:
31
>I want to be able to use every constant in .H file defined with #DEFINE anywhere in my application (in forms, programs, classes...).
>How can I do that?
>
>
>I have put #INCLUDE in my MAIN.PRG but I the constants from .H file are visible only in that program, I want to be visible everywhere.

You have more work to do. The best you can do isput the include file in all your own base classes. Open your baseclass library [VCX] in the Class Browser. For every one of your classes, open them in the Class Designer, click on the Class menu pad, then click Include File... and enter the name of your header file. The following code will do this for all classes in a VCX. For forms, just use adir() to get a list of all .SCX files to loop through. You would also need to modify the code to read Alt+M [for a Form menu pad] instead of Alt+C for a Class menu pad and change to MODIFY FORM instead of MODIFY CLASS.
lnRetVal = AVCXCLASSES(laClasses, [classes\_baseclass.vcx])
FOR lnI = 1 TO lnRetVal
   lcClass = laClasses[lnI, 1]
   KEYBOARD '{Alt+C}I{Tab}{Tab}your_path_here\h_FileName_here.h{Enter}{Ctrl+W}'
   MODIFY CLASS (lcClass) OF classes\_baseclass
ENDFOR
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform