Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing an integer OUT parameter
Message
De
22/12/1997 22:49:49
 
 
À
22/12/1997 22:06:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00067640
Message ID:
00067649
Vues:
35
Most probably buflen is the length of the buffer. So, it should be 512 in your case. Are you sure that buflen must be passed by reference? You must pass it correctly, otherwise the memory address will be passed instead of the value or the other way. And this very probable from the error you have.

Basically, for numerical types, you don't need to convert anything. VFP does this for you.

Can you give the function prototype (ie the function declaration in the original language)?

Vlad

>Hello, I am having some difficulty passing an integer OUT parameter
>to a customer provided DLL. VFP crashes upon calling the particular
>function, althought we are successful passing structures in and out of
>the DLL. It appears that the numeric type is a catch all data type for floats and integers alike, which is too large if the function is
>expecting a 4-byte variable. I tried using a function such as DexToHex to try to crunch it down into a 4 byte string, but then the prototype is a pointer to a character instead of a string which doesn't work. Any ideas? Thanks, here is an example of the code:
>
>DECLARE INTEGER DecomposeMessage IN api STRING @,INTEGER,STRING
>@,INTEGER @
>
>(nextMessage is a customer defined strucure)
>
>buffer=space(512)
>buflen=0 (I think it is this variable that is hosing things up.)
>
>msgDecomp= DecomposeMessage(@nextMessage,512,@buffer,@buflen)
>
>Page fault occurs here...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform