PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Outlook remains in memory... and OL2000 crahes

Reply

Outlook remains in memory... and OL2000 crahes

 
Thread Tools Rate Thread
Old 16-07-2003, 12:02 PM   #1
LukeV
Guest
 
Posts: n/a
Default Outlook remains in memory... and OL2000 crahes


Ok, let me start over. The code below shows that I do handle the
ExplorerClose event. Everything works like a charm with OL2002, as long as I
set m_spExplorer = NULL in OnExplorerClose(). If I don't OL2002 remains in
memory for a few seconds and OL2000 remains way longer. If I don't set
m_spExplorer = NULL, then OL2000 will crash. Crashes will occur if I change
the selection in the Folder List view, like say selecting Journal (has to be
a special folder) and then selecting Inbox.

When the crash occur, the next time OL2000 is restarted, the plugin's menu
item will be duplicated. If I do a Reset of the menu, and that I do change
the selection in the Folder List, then OL2000 won't crash!

I really don't know what to do... help!

CComPtr<Outlook::_Explorer> m_spExplorer;

OnConnection()
{
...
m_spExplorer = NULL;
CComPtr<_Explorer> spExplorer = NULL;

spApp->ActiveExplorer( &spExplorer );
ATLASSERT(spExplorer);
m_spExplorer = spExplorer;

if( spExplorer )
{
hr = spExplorer->get_CommandBars(&spCmdBars);
if(FAILED(hr))
return hr;
ATLASSERT(spCmdBars);
}
...
hr = ExplorerBeforeFolderSwitch:ispEventAdvise((IDispatch*)m_spExplorer);
if(FAILED(hr))
return hr;

hr = ExplorerClose:ispEventAdvise((IDispatch*)m_spExplorer);
if(FAILED(hr))
return hr;
...
}

OnBeforeSwitchFolder()
{
NewFolder->QueryInterface( IID_MAPIFolder, (void**)&pFolder );

m_pCurrFolder = pFolder;

UpdateUI();
}

OnExplorerClose()
{
hr = ExplorerClose:ispEventUnadvise((IDispatch*)m_spExplorer);
hr =
ExplorerBeforeFolderSwitch:ispEventUnadvise((IDispatch*)m_spExplorer);

m_spExplorer = NULL;
}


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off