Dear All, I am trying to create a call back for som events generated by a COM server that I connect. Looking at some posts apparently related to the same topic, I wrote this sample code to test:
import win32com.client as com from win32com.client import gencache class Eventi: def Device_Notify(self,EventCode): if EventCode==0: print "begin" elif EventCode==1: print "end" mod = gencache.EnsureModule('{B4955EC7-F7F2-11D2-AA9C-444553540000}', 0, 1, 0) ob = mod.Application() objCybio = com.DispatchWithEvents(ob, Eventi) When I run this code, it starts the connection, but soon after it is stopped with the following error: Traceback (most recent call last): File "evento.py", line 13, in <module> objCybio = com.DispatchWithEvents(ob, Eventi) File "D:\Python27\lib\site-packages\win32com\client\__init__.py", line 256, in DispatchWithEvents raise TypeError("This COM object can not automate the makepy process - please run makepy manually for this object") TypeError: This COM object can not automate the makepy process - please run makepy manually for this object I did run the makepy, but still the same error. Do you have any suggestion of what it could be wrong? Thanks a lot for your help Nicola
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32