Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variant and SafeArray
Message
From
30/09/2011 08:24:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01525234
Message ID:
01525238
Views:
66
>>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
>
>
>Something like:
>
>oTestCOM.Retrieve(1, @SomeVar1, @SomeVar2,;
>                     @SomeVar3, @SomeVar4,;
>                     @SomeVar5, @SomeVar5,;
>                     @SomeVar6)
>
No this doesn't work. No matter what the "SomeVar" variables are. It has something to do with passing what the support guy calls "SAFEARRAY" data type ?
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform