Need Advice on designing ATL inproc Server (dll) that serves as both a soure and a sink of events.

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-04-13T18:19:56Z Indexed on 2010/04/13 18:23 UTC
Read the original article Hit count: 234

Filed under:
|

Hi,

I need to design an ATL inproc server that besides exposing methods and properties, also can fire events (source) and serve as a sink for a third party COM control that fires events. I would assume that this is a fairly common requirement. I can also foresee several "gotchas" that I would like to read up on before commencing the design. My questions/concerns are:

  1. Can someone point me to an example?
  2. Which threading model to use?
  3. Should I have a seperate COM object for the sink?
  4. Should I, and how do I, protect certain memory. For example, my server will receive data from the third party control. It will save this, and in some cases, fire an event to interested clients. The interested clients will request the data through a standard method or property. I did try to research this myself. I can find many examples of COM servers that are soures, and some that are sinks, but never both. The only post I did find was this: http://www.generation-nt.com/us/atl-control-an-event-source-sink-help-9098542.html Which strongly advocates putting the sink on a seperate COM object.

Any leads, tutorials or ideas would be much appreciated. Thanks, Andrew

© Stack Overflow or respective owner

Related posts about atl

Related posts about events