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:
00255871
Vues:
26
>If I Replace the BYTE with STRING in VFP, if get the famous Fatal exception error C00005 !, When i use INTEGER, it works but returns wrong values.
>
>Yes the variable names have to be the same as the one in the DLL, it was just a typo.
>
>A Variable Type BYTE in VB is i Think an Integer value from 0 to 255, so why is INTEGER dont work in VFP.
>
An INTEGER type in VFP is 32 bits. You might try SHORT (16 bits), but you'll probably get the same results. The reason I suggested a STRING is that a normal (not Unicode) one character string contains 8 bits which is the size of a BYTE. However, VFP may include a null terminator on the string (CHR(0)) which may be causing the problems you're seeing.

BTW, the only time I've see a DLL function call generate a C5 error is when the value that was passed to a function should have been declared and passed by reference, but the declaration and function passed it by value.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform