Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement