Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#INCLUDE problems....
Message
 
À
01/11/1999 17:24:07
Paul Wyett
Resource Link Software
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00285084
Message ID:
00285142
Vues:
18
Ok, I think I know what's happening. If you only do the #include in the main.prg it's not included in the button.

Is the button based on a class and the click method code is in that class? If yes edit the class and click the class menu - > include file and include the MyConstants.h. Now when the class is compiled it should work.

Is the code in a button that has just been dropped on a form? If yes do the same above with the form menu

Also you can go to Tools - > Options File locations tab and put it in the default include file setting. I think that puts it in anything that gets compiled.

Otherwise, Go to the method where you need the constants and add #INCLUDE MyConstants.h. That will include it for that method only.

.h files only get included in each thing that gets compiled. Say you use a constant in a method in a class. When that class gets compiled vfp looks for the include file for the class and replaces any constants. If the include doesn't exist or isn't specified vfp assumes the constant is a variable (and splat).

hth

>It comes up undefined when the code is executed from a command button using the constant MB_ICONINFORMATION, which has been defined as 64 in Foxpro.h, which has been included in efgconst.h with a #include statement.
>
>I changed the code to call the foxpro.h file from main, and the constant comes up in a messagebox as equal to 64,
>
>
>*main.prg
>
>#include Foxpro.h
>
>messagebox(str(MB_ICONINFORMATION))
>
>*end main
>
> which is correct. The code that causes the error is in a click event on an application object created by the main application.
>
> lcMsgText = "Invalid User or Password. Try again."
>---> lnDialogType = MB_ICONINFORMATION + MB_OK
> =MESSAGEBOX(lcMsgText, lnDialogType, oApp.cAppName)
>
>
>---> causes error variable MB_ICONINFORMATION is not found
>
>Why is it defined at one point and then causes the error?
>
>Paul
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform