Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DECLARE DLL problem
Message
De
15/11/2001 02:46:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/11/2001 11:14:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00580332
Message ID:
00581917
Vues:
31
Then on passing parameter to DLL initialize it to replicate(chr(0),8*nDoubles).
Cetin
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform