[python-win32] Returning objects from COM

Danie Roux droux at tuks.co.za
Sat Sep 25 17:12:08 CEST 2004


I don't know COM at all, and fter spending a few hours being confused by
this, I hope someone have an answer for me:

How do I return a custom Python object from a COM server? All examples and
literature I find only allows me to return primitive types.

Basically I want this to work:

o = win32com.client.Dispatch("MyOwnObject.Name")
" person is a complex object of type Person
person = o.getPerson("John Doe")
print person.getName()

-- 
Danie Roux *shuffle* Adore Unix




More information about the Python-win32 mailing list