![]() |
win32com how to catch events
Hello,
I have a VBS sample code that I need to rewrite into python. It calls a com object which then generates events. My problem is that I don't know how to catch this events. VBS sample looks like this: Set oCOV = WScript.CreateObject( "RainbowObjectHandlerSrv.RainbowCOV", "oCOV_") ' like WithEvents in VB(A) Sub oCOV_Update( ObjectId, ObjInstDataCOV) 'some code End Sub I tried like this: from win32com.client import DispatchWithEvents class Events: def Update(self, ObjectID, Data): print('update event') oCOV = DispatchWithEvents("RainbowObjectHandlerSrv.Rainbo wCOV", Events) my code can be found here: http://pastebin.com/EgfippzD but the event newer gets called. Any idea what I'm doing wrong? |
| All times are GMT. The time now is 08:22 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.