Outlook crashes at shutdown... explorer problem?

L

LukeV

I have these events:

(Outlook::ExplorerEvents)> ExplorerBeforeFolderSwitch;
(Outlook::ExplorerEvents)> ExplorerClose;
(Outlook::ApplicationEvents)> ApplicationQuit;

This pointer:

CComPtr<Outlook::_Explorer> m_spExplorer;

ExplorerBeforeFolderSwitch::DispEventUnadvise((IDispatch*)m_spExplorer);

In OnExplorerClose:
{
// Get the Command Bar position
if( m_spCmdBar )
{
m_spCmdBar->get_RowIndex( &reg.m_nCBRowIndex );
m_spCmdBar->get_Left( &reg.m_nCBLeft );
}

hr =
ExplorerBeforeFolderSwitch::DispEventUnadvise((IDispatch*)m_spExplorer);

hr = ExplorerClose::DispEventUnadvise((IDispatch*)m_spExplorer);

m_spExplorer = NULL;
}


I set m_spExplorer = NULL so OnApplicationQuit will get called (it won't if
I don't set the pointer to NULL). In Outlook 2002, this works fine but
setting the pointer to NULL will crash Outlook 2000.

By the way, the crash will only occur if I change the selection in the
Folder List view...

Any hints? Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top