MichaelMaromm
asked on
Connection points - advise question
Hi,
I want to make advise for a connection point in my MFC application.
I need an IUnknown pointer of the sink, to pass it as an argument for 'advise' method.
My question is, how to get this pointer ?
Thanks
Michael
I want to make advise for a connection point in my MFC application.
I need an IUnknown pointer of the sink, to pass it as an argument for 'advise' method.
My question is, how to get this pointer ?
Thanks
Michael
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi pcj0961,
Thanks for your answer,
The compiler want the IDispatch implementation at the interface map :
BEGIN_INTERFACE_MAP(CMainF rame, CFrameWnd)
INTERFACE_PART(CMainFrame, DIID__IHVACEvents, HVACEvents)
END_INTERFACE_MAP()
How can I add the IDispatch implementation to my MFC sink ?
Thanks
Michael.
Thanks for your answer,
The compiler want the IDispatch implementation at the interface map :
BEGIN_INTERFACE_MAP(CMainF
INTERFACE_PART(CMainFrame,
END_INTERFACE_MAP()
How can I add the IDispatch implementation to my MFC sink ?
Thanks
Michael.
Tipicaly, you will create an object on the client side which will implement the same interface as the one in the connection point object you want to connect to. Then you will create the instance of this object (now you have the pointer), and pass its IUnknown to Advise function...