Fire Event from Worker thread in ATL COM Loaded on a Web Page
-
Hi All, I have developed a ATL COM which has a dependency , i have registered callback function of ATL COM to the dependency , which is ultimately invoked by one of the thread of the dependency and i am firing Event when callback funciton is invoked from callback function in ATL COM , Also i have implemented the way it is given the to fire event from Worker thread including atlcmplimpl.h ..... etc.. The event is fired from the worker thread correctly but .. My problem is in Internet Explorer , When ATL COM fires event once , the event is shown on internet explorer more than once as if event is fired many times... i.e each event is shown repeatedly and count is increasing every time.. I have tested ATL COM on VB Client it is working fine on the VB but it is giving problem in the internet explorer... Here is the code snippet... //EventCallBack is registered as call back function in depedency module // It is static function of CCallMonitor as it was to be registered as //callback function int CCallMonitor::EventCallBack(void* pData) { HRESULT hRes = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); MessageBox(NULL,TEXT("Fire Event Reached"),TEXT("OK"),MB_OK); //g_CallMonitor is the pointer to the COM CLass g_CallMonitor->Fire_IncomingCall((BSTR)Objbstr); ::CoUninitialize (); MessageBox(NULL,TEXT("After Test Reached"),TEXT("OK"),MB_OK); return S_OK; } MessageBox for debugging purpose only... Please let me what is the problem with the same... with regards Abhiraj