Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DECLARE DLL problem
Message
From
14/11/2001 11:14:38
 
 
To
14/11/2001 03:41:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00580332
Message ID:
00581566
Views:
22
Thanks to Cetin and Ed. I am trying these advices.

One more thing, On calling my DLL, my array is sent empty, it is returned filled by it. Just, this is the data I am needing. Are you Ok?

Thanks.

Alejandro Fernandez.


>>Well, as I understand funtion DoubleToNum it converts data to valid double one before calling DLL. The following is the code I use:
>>
>>set proce to clsheap addi && Ed clsheap class
>>
>>ascmx = replicate(chr(0),8*10)
>>xdata =DoubleToNum(ascmx) && Is this OK ?
>>
>>retval=MyDll(,,@xdata)
>>
>>The C0000005 error appear after that.
>>
>>Must I convert LONG data type too?
>>
>>
>>Thanks.
>>
>>Alejandro Fernandez
>
>Alejandro,
>I think you got it wrong. In order to pass an array of doubles, first each double should be converted to string then concatanated. On return string is parsed and converted to num :
>
>
dimension myDoubles[6]
>myDoubles[1] = 19292.3773
>myDoubles[2] = 1929243234343
>...
>
>lcDoubleParm = ''
>for ix=1 to alen(myDoubles)
> lcDoubleParm = lcDoubleParm + CopyDoubleToString(myDoubles[ix])
>endfor
>
>* DLL call with @lcDoubleParm
>* Convert back to nums
>dimension myRetDoubles[nDoubles]
>for ix=1 to nDoubles && nDoubles might be constant, returned by DLL etc
>  myRetDoubles[ix]=DoubleToNum(substr(lcDoubleParm, (ix-1)*8+1, 8))
>endfor
Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform