开发者

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

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开发者_Python百科 sink on a seperate COM object.

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


Check out ATL connection points, which will take care of the boiler plate code. This link provides an over view and sample code: http://msdn.microsoft.com/en-us/library/h7kad5hw(v=vs.90).aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜