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:
00256238
Vues:
25
Tanks a lot for the informations, i works great now, you structure class is the best thing since sliced bread. It is great.

I also found the problem to my BYTE type variable with your CONVERT.FLL. Here is how my Fuction call and declare look like now, it works nice.


** -TestApi.Prg
DECLARE INTEGER GetStatus IN SomeDll ;
INTEGER Device , STRING @STATUS, ; && Status is a structure
INTEGER @devStatus, INTEGER mode && devStatus Is Byte Type


IF AT("CONVERT.FLL", UPPER(SET('Library'))) = 0
Set Library To Convert.Fll Additive
ENDIF

IF AT('STRUCT.VCX', UPPER(SET('ClassLib'))) = 0
SET ClassLib TO Struct Additive
ENDIF

oStruct = CreateObject('LStatus')

lnDevStatus = 0
lcStruct = oStruct.GetString()
lnRc = GetStatus(lnDevice, @lcStruct, @lnDevStatus, L_WAIT)
oStruct.SetString( m.lcStruct )

*-- Convert the byte type to Numeric using CONVERT.FLL
lnDevStatus = VAL(FLL_ByteToChar(lnDevStatus))
oStruct.Pstatus = VAL(FLL_ByteToChar(oStruct.Pstatus))

DEFINE CLASS LStatus AS STRUCT
DStatus = 0
DCode = 0
PStatus = 0
cMembers = "l:DStatus,l:DCode,b:PStatus"
ENDDEFINE

*--- End

CHEERS.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform