win32com and "collection"

Mark Hammond mhammond at skippinet.com.au
Wed May 28 23:32:35 EDT 2003


Jess Austin wrote:
> hi,
> 
> I'm having some trouble passing a "collection" to a COM function that is
> expecting it.  I've tried the collection included in win32com.server.util,
> and I've also tried several I've written myself.  I've tried early and late
> binding. 
...
>>>>from win32com.server import util
>>>>from win32com import client
>>>>col = util.NewCollection([])
>>>>obj = client.Dispatch('FooServer.BarObject')
>>>>obj.ProcessData(col, 4)

You will need to "wrap" col - use win32com.server.util.wrap

Mark.





More information about the Python-list mailing list