Need advice on designing an ATL inproc (dll) server that serves as both a sura and a stream of events
I need to design an ATL inproc server that besides exposing methods and properties can also fire events (source) and serve as a receiver for 3rd party COM control that fires events. I would guess that this is a fairly common requirement. I can also foresee a few "gotchas" that I would like to read before starting development. My questions / problems:
- Can anyone point me to an example?
- Which streaming printing model to use?
- Do I have to have a separate COM object for the sink?
- Should I and how should I protect a specific memory. For example, my server will receive data from a third party control. This will save it, and in some cases fire the event to interested customers. Interested clients will request data using a standard method or property. I tried to research it myself. I can find many examples of COM servers that are acids and some are sinks, but never both. The only post I found is this: http://www.generation-nt.com/us/atl-control-an-event-source-sink-help-9098542.html Which strongly protects putting the sink on a separate COM object ...
Any guides, tutorials, or ideas would be much appreciated. Thanks, Andrew
+2
a source to share
1 answer
Check the ATL connection points that will respect the boiler plate code. This link contains view and example code: http://msdn.microsoft.com/en-us/library/h7kad5hw(v=vs.90).aspx
0
a source to share