Python & COM
Stefan Schukat
SSchukat at dspace.de
Wed Mar 31 04:43:53 EST 2004
Hi,
via Dispatch you will always get SAFEARRAYs of VARIANTS since
this is the only array type which could be transported via automation.
You can transport an array of ints only via a custom interface, which
you then wrap with the makegw tool from the PyWin32 source distribution
into a pyd or use the ctypes COM implementation.
Regards
Stefan
-----Original Message-----
From: python-list-bounces+sschukat=dspace.de at python.org
[mailto:python-list-bounces+sschukat=dspace.de at python.org]On Behalf Of
Anand K Rayudu
Sent: Tuesday, March 30, 2004 3:42 PM
To: python-list at python.org
Subject: Python & COM
Hi all,
I have a very primitive question about Python & COM interface.
As of now I have not got any good documentation on using it.
I am planning to buy Python programming on win32 book.
[ It will reach me only after 2 days :-( ]
Could some one please suggest how to add one COM interface which takes
int array as input.
precisely I want to do following
a=[]
a.append(100)
a.append(200)
from win32com.client import Dispatch
o=Dispatch("MyAppl.com")
o.setIntArray(len(a),a)
I am expecting in my COM interface, I will get VARIENT of SAFEARRAY .
in ATL com implementation,
SAFEARRAY *array=V_ARRAY(a);
long i,val;
for(i=0;i<len;i++){
SafeArrayGetElement(array,&i,&val)
c_array[i]= val;
}
I am not getting proper values in C array.
Any suggestions?
Regards,
Anand
--
http://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list