[python-win32] com events while running wx main loop
Christian K.
ckkart at hoc.net
Thu Apr 19 04:32:42 CEST 2007
Thomas Heller wrote:
> Christian K. schrieb:
>> sorry. I forgot the attachment.
>>
>> Christian
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> import unittest
>> import comtypes.client
>>
>> import wx
>>
>> class EventHandler(object):
>> """Instances are called when the COM object fires events."""
>> def __init__(self, view, name):
>> self.view = view
>> self.name = name
>>
>> def __call__(self, this, *args, **kw):
>> self.view.write(unicode("Event %s fired" % self.name, args, kw))
>
> Here is the problem: ^^^^^^^^^^^^
silly. Thanks. Works fine with the old version of comtypes I had installed.
Now I installed comtypes from svn and get this error running your new
example:
Traceback (most recent call last):
File "C:\Dokumente und Einstellungen\ck\Desktop\x.py", line 64, in ?
Listener()
File "C:\Dokumente und Einstellungen\ck\Desktop\x.py", line 50, in
__init__
self.com_init()
File "C:\Dokumente und Einstellungen\ck\Desktop\x.py", line 59, in
com_init
self.s = comtypes.client.GetEvents(self.o, sink)
File "c:\Python24\Lib\site-packages\comtypes\client\__init__.py",
line 358, in GetEvents
raise TypeError("cannot determine source interface")
TypeError: cannot determine source interface
As I'm real beginner with python on windows I'd like to ask some
elementary questions if you don't mind:
1) Does comtypes depend on pywin32?
2) It seems that it provides the same (similar) mapi interface as
pywin32, so can it be used as a replacement for pywin32?
3) Does comtypes expose the extended mapi?
Thanks for your help, Christian
More information about the Python-win32
mailing list