SebastianStricker
Programmer
I have a question to the COM/ATL experts: how can I handle events fired by an application I created via a smart pointer ("CreateInstance"?
I know that in the namespace of the imported DLL from the program (which I created with "CreateInstance" there is an abstract base class for event handling (lets say "_IEvent".
I tried to create my own event handling class derived from IDispatchImpl<_IEvent,...> and CComObjectRoot. Then I overrided the event-handling functions existing in the abstract _IEvent class in my new event handling class. Furthermore I created a COM_MAP with two entries for "IDispatch" and "_IEvent" in the header.
Then I call AtlAdvise with the both IUnknown pointers to the object and my class. As IID I used the GUID of the abstract _IEvent class (don't know if this is right??)
There seems to be a valid connection, but nothing happens if the created instance fires COM events? I think it is possible that there is no connection between the messages and the functions.
Any ideas?
THX Sebastian
I know that in the namespace of the imported DLL from the program (which I created with "CreateInstance" there is an abstract base class for event handling (lets say "_IEvent".
I tried to create my own event handling class derived from IDispatchImpl<_IEvent,...> and CComObjectRoot. Then I overrided the event-handling functions existing in the abstract _IEvent class in my new event handling class. Furthermore I created a COM_MAP with two entries for "IDispatch" and "_IEvent" in the header.
Then I call AtlAdvise with the both IUnknown pointers to the object and my class. As IID I used the GUID of the abstract _IEvent class (don't know if this is right??)
There seems to be a valid connection, but nothing happens if the created instance fires COM events? I think it is possible that there is no connection between the messages and the functions.
Any ideas?
THX Sebastian