Add-in stops getting notifications

  • Thread starter Thread starter David Schwartz
  • Start date Start date
D

David Schwartz

I wrote a C# COM add-in based on the sample from MSDN.
In OnConnection() I sign up for the
applicationObject.Inspectors.NewInspector event using the
following code:
applicationObject.Inspectors.NewInspector +=
new Outlook.InspectorsEvents_NewInspectorEventHandler
(NewInspectorMethod);

At some point I stop getting this notification.
To be more specific, when I open a new meeting request, I
add some buttons to the command bar, and when I open one
of my forms, by pressing these buttons, I stop getting
the NewInspector event.
I've checked that I don't have any unhandled exceptions
in my code, so I don't think that my code caused the add-
in to unload.

Is this a known issue? if so, is there anything I can do
to solve it?
 
Try to store applicationObject.Inspectors as a class variable and set up the
events as:

m_inspectors = applicationObject.Inspectors;
m_inspectors .NewInspector += new
Outlook.InspectorsEvents_NewInspectorEventHandler(NewInspectorMethod);

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top