Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variant and SafeArray
Message
From
30/09/2011 08:01:48
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Variant and SafeArray
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01525234
Message ID:
01525234
Views:
135
Hello All

I am trying to use OLE to automate a 3rd party application. Everything works fine except a single function call that requires some variables to passed by reference. Here is the example:
Function Retrieve(ByVal Count As Long, ByRef Date As Variant, ByRef Open As Variant, ByRef High As Variant, ByRef Low As Variant, ByRef Close As Variant, ByRef Volume As Variant, ByRef OpenInt As Variant) As Long
No matter what variable type I pass I always get a "type mismatch" error message. I contacted their support department who came back with this response:

This function requires that the language from which you are calling it
supports SAFEARRAY data type that is used by Retrieve to return data.
Visual Basic for Applications can do that. C++ can do that.
Scripting languages (JScript/VBScript) don't offer this data type.

So my question - is there a way to handle this in VFP9?

TIA
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Next
Reply
Map
View

Click here to load this message in the networking platform