Python & COM

Anand K Rayudu anand at easi.soft.net
Tue Mar 30 09:41:42 EST 2004


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






More information about the Python-list mailing list