passing dictionaries through COM

Stefan Schukat SSchukat at
Fri Jan 11 13:08:34 CET 2002


there is no such type as mapping in oleautomation. If you
want to have a mapping type you must pass an object which 
behaves like a dictionary. A sample COM server which acts
like a dictionary is in 


How to wrap Python objects as return values in COM servers could 
be in the book of Mark and Andy.


> -----Original Message-----
> From: Ken Guest [mailto:kwg at]
> Sent: Friday, January 11, 2002 12:14 PM
> To: Python List
> Subject: passing dictionaries through COM
> hi,
> Does anybody know if it is possible to return a dictionary through COM
> to a VB application?
> I have tried a simple return {1: "a", 2: "b"} from my python code and
> get an error raised "Unexpected Python Error: exceptions.TypeError:
> Objects of type 'dictionary' can not be converted to a COM 
> VARIANT' and
> was wondering if there is any 'deep magic'/advanced method of
> transferring a dictionary of information to a COM based client.
> Any help/advice would be greatly appreciated
> -- 
> The duck quacks.
> -- 

More information about the Python-list mailing list