win32com: getting a list of longs from a C++ COM object

Achim Domma achim.domma at syynx.de
Wed Dec 4 11:42:58 EST 2002


Hi,

I have written a COM object (in C++) which returns a list of longs. To make
this list accessible for other scripting languages like VBScript and JScript
I have to declare my function like this:

HRESULT myFkt([in]BSTR column,[out,retval]VARIANT* ids);

'ids' will be a pointer to a variant which contains a SafeArray(ids->vt =
VT_ARRAY|VT_VARIANT). The SafeArray contains variants, which contain the
longs. Is it possible to access this array from python? It works, if I don't
wrap the SafeArray in a Variant, but then it does not work for VBScript and
JScript.

regards,
Achim





More information about the Python-list mailing list