Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing SAFEARRAY of SHORT from Visual FoxPro to a C++ C
Message
 
 
To
28/01/2003 09:57:41
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00746183
Message ID:
00749188
Views:
22
I think VB wrapper is the way to go in such case.

>Hello
>
>I'm using Visual FoxPro 7 and I'm trying to call a Method from a C++ COM component which expect from me 2 SAFEARRAY of SHORT. I don't have access to the COM component source code.
>
>The method has the following definition :
>component.FindList(VT_ARRAY VT_I2 "list to find", VT_PARRAY VT_I2 "list found")
>
>I've read when Visual FoxPro call a COM Component, VFP convert it's internal array to a SAFEARRAY of VARIANT. So I've found on levelextreme.com some code to create SAFEARRAY of different type :
>
>http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,84,14,7979
>
>I've added the following code in BuildElement FUNCTION to use SHORT
> CASE tnElementType = 2 && Short
> uResult = NumToSHORT(tuElementSource)
>
>I use the AllocSafeArraySingleDimensional FUNCTION and this FUNCTION return a pointer.
>You can take a look a the code below.
>
>I've tried many ways, but nothing seems to work. I always get the following error :
>Ole error code 0x80020005: Unknown COM Status.
>
>Now I've got some questions :
>- Can I call the COM Component method with the pointer of the SAFEARRAY ?
>- Must I initialize the second array vListFound ? If yes, how ?
>- How the COM component will return me the second array vListFound. A pointer ?
>- If the the method call works, how can I read data of the vListFound array in VFP, if I have only the pointer of this SAFEARRAY ?
>- It is possible to do this with Visual Foxpro 7 ?
>
>With Visual Basic the method call works well, but I will only make a VB wrapper if it's impossible to call this method from Visual Foxpro.
>
>
>Thanks for your help
>
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform