win32com.client passing a list of values to a C++ COM object.

Raoul raoulsam at yahoo.com
Fri Jun 18 20:50:42 CEST 2004


tim.golden at viacom-outdoor.co.uk (Tim Golden) wrote in message news:<8360efcd.0406140009.360521f5 at posting.google.com>...
> raoulsam at yahoo.com (Raoul):
>   > I wrote a COM server object in C++ a few months ago. I can use it from
>   > Visual Basic, Visual C++, S-Plus and a number of other scripting
>   > environments.
>   > 
>   > What I can't do is use it with my FAVOURITE scripting language,
>   > Python.
>   > import win32com.client
>   > 
>   > vals = [1.2,1.4,1.5,3.4]
>   > 
>   > seg = win32com.client.Dispatch("CN.averager")
>   > seg.learnAndRun(vals)
> 
> OK. I'm absolutely no expert here, but I understood that
> pywin32 automatically converted an arbitrary Python sequence
> to an array of VARIANTS. If you haven't already, have a look
> at this chapter of Hammond & Robinson's Python Win32 book:
> 
> http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html
> 
> Also, try posting to the python-win32 list, in the hope
> that someone more knowledgeable than I see your post:
> 
> http://mail.python.org/mailman/listinfo/python-win32
> 
> TJG

I found it. It was a subtle bug in my COM class. Basically my code
expected row major layouts of lists and python did it's in column
major form...



More information about the Python-list mailing list