Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variant and SafeArray
Message
From
12/10/2011 03:06:32
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01525234
Message ID:
01526107
Views:
66
OK, thanks Rick. Will look at getting wrapper built.


>Ah yes the good old problem of FoxPro and arrays that won't travel over COM :-) VFP arrays suck - the single worst feature in the FoxPro language.
>
>I remember struggling with this some time ago as well, and never found an acceptable solution. FoxPro can't properly create COM array types because FoxPro arrays are laid out differently. FoxPro can READ SafeArrays with the help of COMClassInfo but it can't create arrays that travel well over COM. For some reason I thought VFP 9 added some SYS() function that helped with this but I can't seem to find it in the help file now.
>
>I'm with Thomas on this: Create a wrapper in VB or C code and use that to build up a safe array and pass that through.
>
>While you're at it you might as well make that a generic SafeArray class that holds the array in VB (or whatever you use). I've done something similar for .NET interop in wwDotNetBridge here:
>
>http://www.west-wind.com/webconnection/wwClient_docs/_2mq0jxk83.htm
>
>Maybe the interface will give you some ideas...
>
>+++ Rick ---
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Reply
Map
View

Click here to load this message in the networking platform