Outlook add-in - multiple explorer of OL and Close Problems vc++

So now here i am going to write about the issues that came when i was developing the outlook add-in.
1 - On outlook close issues:
Outlook never call begin shutdown(...) method while any of its resourece and object is in use and not properly released.so handle all the case while u are shutting down your add-in to ensure that your add-in released all outlook objects and resources.
eg... before closing ensure all the explorer object that u have used for your add-in, has properly released.
2. Stop all the threads that are runnng inside your addin before outlook close.
3 . In case of multiple explorer of outlook bimd each explorer close event so that it would be easier to realease particular explrer object on its close.
4. In case of multiple explorer first un advise the previous events and then advise new event.
HRESULT hr;
hr = BrechaMeetingButtonEvents::DispEventUnadvise ((IDispatch*) m_spMeetingButton[m_ExpCount - 1]); //BRECHA_LOG(" DispEventAdvise((IDispatch*)m_spMeetingButton);");
hr = BrechaMeetingMenuEvents::DispEventUnadvise ((IDispatch*)m_spMeetingMenuItem[m_ExpCount - 1]); //BRECHA_LOG("DispEventAdvise((IDispatch*)m_spMeetingMenuItem);");
//MessageBox(0,_T("Explorer Event"),_T("Office"),0);
CComPtr<spExplorer">Outlook::_Explorer>spExplorer; pDisp->QueryInterface(__uuidof(IDispatch), (LPVOID*)&spExplorer); m_spExplorer = spExplorer; m_spExplorer->Activate();
if(m_spExplorer) {
BrechaErrorType errCode = AddMeetingButton();
hr = BrechaMeetingButtonEvents::DispEventAdvise((IDispatch*)m_spMeetingButton[m_ExpCount]); BRECHA_LOG(" DispEventAdvise((IDispatch*)m_spMeetingButton);");
if(m_OLVer_A >= 12) { errCode = AddMeetingMenuItem();
if(errCode == S_OK)
hr = BrechaMeetingMenuEvents::DispEventAdvise((IDispatch*)m_spMeetingMenuItem[m_ExpCount]); BRECHA_LOG("DispEventAdvise((IDispatch*)m_spMeetingMenuItem);");
}
m_ExpCount++; }

Comments

Popular posts from this blog

XML Programming using IXMLDOMDOCUMENT in vc++

Get correct OS version on win 8.1 without using GetVesionEx API (deprecated )