[python-win32] Python COM

Tim Golden mail at timgolden.me.uk
Thu Jul 31 10:30:00 CEST 2008


birdprince wrote:
> I have implemented a COM in C++,buy i don't know how to use this COM 
> in python. 
> For example: the COM's ProgID is "MyCOM1.AdvMethod".this COM have two 
> interfaces,the default interface's name is IAdvMethod,the second 
> interface's name is IBasicMethod.
> I use this method to call the IAdvMethod's method,because IAdvMethod is the 
> default interface
> code example:
> import win32com.client 
> moncom = win32com.client.Dispatch('MyCOM1.AdvMethod') 
> moncom.IAdvMethod(... 
> 
> who can tell me how to call the IBasicMethod's method?Thank you very much! 

Well that looks like 3 emails in a few hours. And to the same
list. Remarkable.

In general, the win32com from pywin32 can't handle arbitrary
non-Dispatch interfaces. 

Try comtypes: http://sourceforge.net/projects/comtypes

TJG


More information about the python-win32 mailing list