Re: [Ctypes-devel] Connection Points Implementation
Brought to you by:
theller
From: Shane H. (IEEE) <sha...@ie...> - 2005-05-23 18:02:02
|
Thomas Heller wrote: > Shane, thanks for the patch. I have my own version of this patch, but > yours is probably better. My own one only supports a single outgoing > interface, but yours looks like it supports more of them. As a bonus, > my version actually supports to 'fire' the events, and even from > different threads. I'll try to merge both and check them into CVS. The > approach to fire the events is quite simple, here it is (I hope > thunderbird doesn't destroy the formatting): <snip> Ok, I tried to implement the fireEvent in what I have, but I keep getting an exception that says:: TypeError: function takes at most 3 arguments (9 given) For sink.Invoke(). It obviously takes 9 parameters, but I can't seem to convince the system of that. ;) Any thoughts? :: def fireEvent(*args): for sink in self._iterConnectionPointSinks(): params = DISPPARAMS() params.cArgs = len(args) rgvarg = params.rgvarg = (VARIANT * len(args))() for i, a in enumerate(args): rgvarg[i].value = a Invoke = dict(sink._methods_)['Invoke'] Invoke( sink, dispid, byref(GUID()), 0, # lcid DISPATCH_METHOD, # wFlags byref(params), None, # pVarResult None, # pExcepInfo None) # puArgError The patch of my attempt is attached. Thanks, -Shane |