def GetExternal(self, this, ppDispatch): print "GetExternal!" dispSum = dispatch.wrap(Summer(self)) iDispSum = dispSum._com_pointers_[0][1] addr = c_voidp.from_address(addressof(ppDispatch)).value ptr = addressof(iDispSum) c_voidp.from_address(addr).value = ptr dispSum.AddRef(None) dispSum.AddRef(None) return S_OK
def announce(self, element): print "announce", element self.handler.element = dispatch.wrap(element)