Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning arrays from COM
Message
De
02/02/2002 11:35:36
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00614187
Message ID:
00614395
Vues:
26

>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!

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform