[plt-scheme] MysterX again - This time about passing arrays/vectors to COM methods

From: Filipe Cabecinhas (filcab at gmail.com)
Date: Sun Feb 24 07:41:11 EST 2008


I'm trying to use a COM method that takes two arrays. This is how you  
use it in VB:

Dim startPoint(0 To 2) As Double, endPoint(0 To 2) As Double
startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0
endPoint(0) = 30: endPoint(1) = 20: endPoint(2) = 0

I tried to do something like:

 > (define v1 (vector 0.0 0.0 0.0))
 > (define v2 (vector 30.0 20.0 0.0))
 > (com-invoke v "method" v1 v2)
. COM object exception, code = 80070057: The parameter is incorrect.

But I just get these errors. The com-method-type function returns (mx- 
any mx-any -> com-enumeration), which isn't quite right. Anyone knows  
how to get over this? How can I pass arrays/vectors to a COM method?  
In the source code for MysterX it seemed it converted them with the  
function "SAFEARRAY *schemeVectorToSafeArray(Scheme_Object *vec)"


Posted on the users mailing list.