Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning arrays from COM
Message
From
02/02/2002 11:35:36
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00614187
Message ID:
00614395
Views:
25

>The function I'm calling is:
>Sub GetPrices(WordenNum As Long, OpenPrices() As Single, HighPrices() As Single, LowPrices() As Single, ClosePrices() As Single, Volumes() As Long, Dates() As Long, NumberOfPricesToGet As Long)


As I see you use VB COM component. I sugest that you make all array parameters VARIANT type, because VFP strong-typing is not really "very strong"
(I belive that behind the scenes strong-typed variable with a simple type do not differ from non-strong-typed variable)


>After defining each array like this:
>LOCAL ARRAY Volumes[5]
>STORE "X" TO Volumes

I suggest that you STORE the empty value of the proper type (e.g. 0(zero) for integer types; 0.0 for real types; etc.)

>And then calling like this:
>mbhtemp1=otc.GetPrices(9996, @OpenPrices, @HighPrices, @LowPrices, @ClosePrices, @Volumes, @Dates, lcNoOfPrices)

This is OK

>I have tried using COMARRAY() with different values, but same result.
COMARRAY(MyObject, 11) is the correct setting according to me.

Hope this helps
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform