Each "copy" of IDispEventSimpleImpl
you inherit from keeps a so called "cookie", a value you provide back to the connection point later when you need to unadvise/disconnect from events. Having said that, IDispEventSimpleImpl
class (note word "simple" in the name) supports only one connection.
Your choices are:
- rewrite
IDispEventSimpleImpl
class so that replacement class could connect to multiple points properly managing the connections - create one helper instance of connection point sink class per connection, then forward calls back to the owner making it gather calls from multiple sources - recommended
- inherit several times from different
IDispEventSimpleImpl
bases to support more (fixed amount though - lacks flexibility, good for several connections one per source type) connections on a single instance