Error firing callback event
-
My COM server should fire the event of a VB client. The code (generated by the Wizard) is as follows HRESULT Fire_GetResult(VARIANT retResult) { CComVariant varResult; T* pT = static_cast(this); int nConnectionIndex; CComVariant* pvars = new CComVariant[1]; int nConnections = m_vec.GetSize(); ... ... The problem here is that m_vec.GetSize returns 0 and hence the for loop to fire the event is not called and return value is 0xCCCCCCCC However firing the event works intially and after a few function calls, it stops working! I am totally confused what could the problem be. Is it because of some memory leak or anything else. Please comment on possible problems. Also I would like someone to tell me whose responsibility it is to free the BSTR or VARIANT arguments in interface method, server or clients? for both by value and by reference type. Thank You Mayur Mahajan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~