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.RainbowCOV", Events)

my code can be found here: http://pastebin.com/EgfippzD
but the event newer gets called. Any idea what I'm doing wrong?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to