Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB Call to API vs VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00255827
Message ID:
00256468
Vues:
23
Hi Stephane,

>DECLARE INTEGER GetStatus IN SomeDll ;
> INTEGER Device , STRING @STATUS, ; && Status is a structure
> INTEGER @devStatus, INTEGER mode && devStatus Is Byte Type
>*-- Convert the byte type to Numeric using CONVERT.FLL
>lnDevStatus = VAL(FLL_ByteToChar(lnDevStatus))
>oStruct.Pstatus = VAL(FLL_ByteToChar(oStruct.Pstatus))

If devStatus is a byte type passed by reference, the easiest way is to pass it as a string. You can use ASC(lcDevStatus) to convert it into a numeric value after calling the API function. And you shouldn't have to call the conversion routine fpr PStatus. Since you declared it as a byte, the struct class does all the conversion for you. The only thing that might be neccessary is to declare it as "ub:", an unsigned byte.

Christof
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform