0

I want to use python to handle events from a COM server component. This server has a register() method which receive an IDispatch object and invokes OnXXX methods on it when various events are generated.

Can you achieve this with win32com.client or other python library? I didn't found a real example for doing so.

Pseudo-code:

 class handler(object):
     def onXXX(arg1, arg2):
         pass
     def onYYY(arg1):
         pass
 h=handler()
 server.register(h)

Thanks!

Uri Cohen
  • 3,488
  • 1
  • 29
  • 46
  • Yes you can do this with win32com or if you wish with comtypes – joojaa May 12 '13 at 18:19
  • Any additional pointer for sample code or documentation? – Uri Cohen May 12 '13 at 20:15
  • Its a bit hard to give any good pointers. COM programming is a bit weird at best of times. So even if you would see an example it would not necessarily help you much. There may be many complications on the way. Such as needing to cast data, make the signatures of the calls methods because the server isnt actually doing a proper job etc. etc. It would help you if we would know what the server ate. Knowing the application if possible would hep a lot. – joojaa May 12 '13 at 21:08

0 Answers0