Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stumped by a DLL
Message
From
04/10/2005 15:02:26
 
 
To
04/10/2005 13:56:16
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01052286
Message ID:
01056007
Views:
26
Hello,

i assume you're currently passing the array in a character variable and DECLAREing the array parameter as STRING type, maybe your DoubleArrayToString routine has some faults?

you may have a look at download #28338, it contains a class called "CDoubleArray" in the file "vfp2c.prg" which is a wrapper around a real C style array of doubles

you may use it like:
&& init library as described in help ..
LOCAL ArrayWithYourValues[20], loCArray, lnParm1, lnParm2
&& init ArrayWithYourValues from somewhere ...
loCArray = CREATEOBJECT('CDoubleArray')
loCArray.MarshalArray(@ArrayWithYourValues)
&& now loCArray has created a copy of your array as an C style array
&& you can pass to your DLL function
DECLARE INTEGER foo IN foo.dll DOUBLE @ someParm1, DOUBLE @ someParm2, INTEGER theArray

lnParm1 = 0.0
lnParm2 = 0.0
?Foo(@lnParm1,@lnParm2,loCArray.Address)
&& loCArray.Address contains the real memory address of the C style array ..
that's the only thing that currently comes to my mind ... since your question was somewhat "generic" in nature ..

Regards
Christian
Previous
Reply
Map
View

Click here to load this message in the networking platform