G
Gabriel
Another newbie question here. I'm writing an ATL/COM add-in for Outlook 2003.
When quitting Outlook, I was getting an "abnormal program termination" error.
If I understand correctly, this is probably a result of not releasing my
Explorer object pointer? I added a sink for the explorer close event as
recommended but I guess I have to do something other than just set my pointer
to NULL?
(My pointer is: CComPtr <Outlook::_Explorer> m_spExplorer
Here's my code (checking to see if this is the last :
// gives an "assertion failed" error
void _stdcall CAddin::OnExplorerClose(){
CComPtr <Outlook::_Explorers> spExplorers;
m_spApp->get_Explorers(&spExplorers);
long count;
spExplorers->get_Count(&count);
if (count == 1){
spExplorerEvents:ispEventUnadvise((IDispatch*)m_spExplorer);
spExplorerEvents2:ispEventUnadvise((IDispatch*)m_spExplorer);
spExplorerEvents3:ispEventUnadvise((IDispatch*)m_spExplorer);
m_spExplorer = NULL;
}
}
As always, any assistance is greatly appreciated.
-Gabriel
When quitting Outlook, I was getting an "abnormal program termination" error.
If I understand correctly, this is probably a result of not releasing my
Explorer object pointer? I added a sink for the explorer close event as
recommended but I guess I have to do something other than just set my pointer
to NULL?
(My pointer is: CComPtr <Outlook::_Explorer> m_spExplorer
Here's my code (checking to see if this is the last :
// gives an "assertion failed" error
void _stdcall CAddin::OnExplorerClose(){
CComPtr <Outlook::_Explorers> spExplorers;
m_spApp->get_Explorers(&spExplorers);
long count;
spExplorers->get_Count(&count);
if (count == 1){
spExplorerEvents:ispEventUnadvise((IDispatch*)m_spExplorer);
spExplorerEvents2:ispEventUnadvise((IDispatch*)m_spExplorer);
spExplorerEvents3:ispEventUnadvise((IDispatch*)m_spExplorer);
m_spExplorer = NULL;
}
}
As always, any assistance is greatly appreciated.
-Gabriel