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

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Jun 14 10:09:52 CEST 2004


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



More information about the Python-list mailing list