Add-in causes Outlook crash when Outlook launches as a result of email hyperlink 
Author Message
 Add-in causes Outlook crash when Outlook launches as a result of email hyperlink

Please let me know if there's a better group to post this to.

I've created an Outlook add-in in C++ that simply adds a button to the
Standard toolbar.  When clicked, the add-in loads a web page in
Outlook by automating the Address combobox.  The button is created as
"temporary", so the add-in creates it each time Outlook loads.

Everything works fine until Outlook is "automatically" launched as a
result of clicking an email hyperlink in a web page when Outlook is
not already running.  In this case, a new Outlook compose window is
opened, followed immediately by the Error Report (crash) dialog.
Outlook also reports that "a serious error occurred" the last time my
add-in was loaded.

Can someone tell me why my add-in loads fine if I launch Outlook
directly, but causes a crash if Outlook is launched indirectly?

TIA

Jared



Mon, 08 Aug 2005 04:43:36 GMT  
 Add-in causes Outlook crash when Outlook launches as a result of email hyperlink
Just off the top of my head, your addin might need to check whether there is an active Explorer window before it starts adding buttons. In fact, if there is no active Explorer, it should unload itself automatically as the Items Command Bar sample from http://www.microeye.com demonstrates.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming: Jumpstart
     for Administrators, Power Users, and Developers
     http://www.slipstick.com/books/jumpstart.htm
Quote:

> Please let me know if there's a better group to post this to.

> I've created an Outlook add-in in C++ that simply adds a button to the
> Standard toolbar.  When clicked, the add-in loads a web page in
> Outlook by automating the Address combobox.  The button is created as
> "temporary", so the add-in creates it each time Outlook loads.

> Everything works fine until Outlook is "automatically" launched as a
> result of clicking an email hyperlink in a web page when Outlook is
> not already running.  In this case, a new Outlook compose window is
> opened, followed immediately by the Error Report (crash) dialog.
> Outlook also reports that "a serious error occurred" the last time my
> add-in was loaded.

> Can someone tell me why my add-in loads fine if I launch Outlook
> directly, but causes a crash if Outlook is launched indirectly?

> TIA

> Jared



Mon, 08 Aug 2005 04:57:53 GMT  
 Add-in causes Outlook crash when Outlook launches as a result of email hyperlink
Thanks for the response, Sue.  I implemented a check on the count of
Explorers.  If there are no Explorers, I do not try to add the button.

Quote:


> Just off the top of my head, your addin might need to check whether
> there is an active Explorer window before it starts adding buttons. In
> fact, if there is no active Explorer, it should unload itself
> automatically as the Items Command Bar sample from
> http://www.microeye.com demonstrates.

In case anyone else runs into the same problem, here's my C++ code
from the OnConnection event (microeye provides a VB sample):

// m_spApplication is the Application interface of the IDispatch param
CComPtr <Outlook::_Explorers> spExplorers;
long cnt = 0;
HRESULT hr = m_spApplication->get_Explorers(&spExplorers);
hr = spExplorers->get_Count(&cnt);
if(cnt == 0)
   return S_OK;

Jared



Mon, 08 Aug 2005 15:26:23 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. outlook:// hyperlinks not working in email message

2. outlook:// hyperlinks not working in email message

3. Newbie: how to launch Outlook Express instead of Outlook

4. Adding a file shortcut / hyperlink to an outlook message

5. Adding a file shortcut / hyperlink to an outlook message

6. Adding a file shortcut / hyperlink to an outlook message

7. Closing Outlook causes Add InOnDisconnection event ...

8. Need Outlook macro to recurse outlook folders and create PDF file of each email

9. cannot connect outlook to email server, but can connect outlook express

10. Since adding VBA outlook crashes.

11. Updating email address in Outlook from VB / Outlook ignores changes

12. outlook add-in crashes on folder-switch

 

 
Powered by phpBB® Forum Software