Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an integer OUT parameter
Message
From
04/01/1998 18:49:52
 
 
To
22/12/1997 22:49:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00067640
Message ID:
00069410
Views:
32
>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...

Thanks Paul.
We had to ask the contractor to revamp the API. I would like to look into
this more when my deadline is finidhed.

Thanks again for the response!
Previous
Reply
Map
View

Click here to load this message in the networking platform