I have a project that is essentially a notifier to listening applications. The base class is a generic C++ class that simply manages data. When the data changes it needs to notify the listeners that something has changed. One of the methods of notification is events.
I have already implemented an ATL class that has events within it. How does my base class notify the ATL class to fire the events?
Sorry if this is simple - I think I am trying to make it more difficult then it actually is. Thanks in advance!
Usually the base class calls a virtual function that is implemented in your ATL class. The ATL class then raises the event with Fire_[eventname](args).
How does the base class call functions within another class?
I created public virtual functions which call the corresponding Fire functions within my ATL class. Should I have created the virtual functions within my base class?
Thank you all for your help thus far. I am still very confused however, and maybe it is because I am not being clear (or just am very confused and have my process implemented incorrectly).
My base class is a generic C++ class which handles data. Within my project I have implemented ATL interfaces for other applications to communicate to me through to access data and to be notified when it changes. These are working fine, but I need to add one more option which is to raise an event when data changes. Is there a way to raise an event without an ATL class that everyone listening can hear?
I apologize if my terminology is not correct (I assume it is not). I believe you are correct, I have implemented a connection point container. I am trying to follow the tutorials for creating an ATL interface class with connection points. I did this because that is the only way I know how to create global events to any attached process. I am trying to raise these events from my base class within this ATL class.
I am currently trying to implement the previous suggestion to yours, but if you have anything I am open to suggestions. I seem to be very stuck on this and it doesn't seem like it should be this difficult.
I have attached my ATL class to try to make more sense. If anyone has an idea of how my base class can fire the events within my ContextParticipant class I am open to anything.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.