Hi, I am stumped by these error messages. I have created an event receiver through comtypes.client.GetEvents and the event routines are called and work, but in the mean time messages like this are generated:
Event PLCSimStateChanged(<comtypes.client._events.EventReceiver object at 0x01E7CF90>, 31758856, u'STOP') Traceback (most recent call last): File "\loewis\25\python\Modules\_ctypes\callbacks.c", line 216, in 'converting callback result' TypeError: int expected instead of NoneType instance Exception in <bound method EventReceiver.handler of <comtypes.client._events.EventReceiver object at 0x01E7CF90>> ignored The first two lines are regular output from ShowEvents, which I have running as well, the other ones (" File ....") are error message. The corrsponding event function looks like this: def PLCSimStateChanged(self, this, NewState): self.logger.log("Event: PLCSimStateChanged: %s\n" % NewState) return 0 for a template from GetModule like this: COMMETHOD([helpstring(u'Fired when a new PLC switch state is detected.')], HRESULT, 'PLCSimStateChanged', ( [], BSTR, 'NewState' )), There are two more observations: - The address in "<bound method EventReceiver.handler of <comtypes.client._events.EventReceiver object at 0x01E7CF90>>" does is reported equal for another event in the same event receiver. - I tried varying the event function a little (returning 1, returning None). When returning None, the messages get to look like this: Traceback (most recent call last): File "\loewis\25\python\Modules\_ctypes\callbacks.c", line 216, in 'converting callback result' TypeError: int expected instead of NoneType instance Exception in <bound method PlcSimEvents.PLCSimStateChanged of <__main__.PlcSimEvents instance at 0x01E873C8>> ignored Event PLCSimStateChanged(<comtypes.client._events.EventReceiver object at 0x01E7BF90>, 31758856, u'STOP') Traceback (most recent call last): File "\loewis\25\python\Modules\_ctypes\callbacks.c", line 216, in 'converting callback result' TypeError: int expected instead of NoneType instance Exception in <bound method EventReceiver.handler of <comtypes.client._events.EventReceiver object at 0x01E7BF90>> ignored i.e. the same trailer, but a header is being added. Anyone have any idea what to do about this? Len remmerswaal ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users