"The Part II example is using IDispatch for the sink interfaces. Have you also tried it using IUnknown for the sink interfaces, or is it that ATL only supports IDispatch for ConnectionPoints???
Are there any performance differences in using ConnectionPoint compared to the custom callback interface?"
I am looking for an answer to the same question... Any advice?
Thankyou _SO_ much for your article and sample project. I've been frustrated by examples in a book (Beginning ATL COM) not working with VC6, and the Dr. GUI article series cut short one article (the most important one--the client!!). Using your sample code, I got my program working. Thankyou, thankyou, thankyou!!!
This article is very useful and completes quite well MSDN samples on the subject. On topic that is not covered anywhere (and I spent days looking) is when the event has a COM object as a parameter. Say for instance in your sample that the addition is not on 2 integers but on 2 matrixes. The OnAdditionDone event would therefore pass a IMatrix * obj (VT_DISPATCH) pointer instead of an integer (VT_I2).
How would you implement the event handler on the client side, and how would you actually start using the IMatrix pointer to access its members (tried everything I could think of, wither it doesn't compile or compiles but crashes). In other words, how to complete this:
void CCoCaller::OnAdditionDone(IMatrix *result)
// How to implement this so that it works:
BSTR str; result->get_Name(str);
MSDN gives 2 samples on how to implement IDispEventSimpleImpl and IDispEventImpl using Word and Excel veents, none of them show events that pass COM objects as parameters.