Event to determine when Outlook disables a plugin

Add-in Express™ Support Service
That's what is more important than anything else

Event to determine when Outlook disables a plugin
 
Subscribe
Mark Wijnbergen




Posts: 16
Joined: 2019-03-18
Hi,

Disabling of our plugin by Outlook is normally prevented by certain registry key settings. However, in some edge cases (wrong settings) it might be possible that Outlook disables our plugin and that the user has to manually add the plugin via File--> Options --> Add-ins to enable the plugin in Outlook.

However, when the plugin is enabled in this manner, a new instance of the AddIn Module is created, whereas the previous has instance has not been closed/disposed. Consequently, a lot of classes are re-instantiated and errors are thrown because those classes should only have one instance. These classes are instantiated because the events we use (`outlookEventListener_Quit`, `AddinUnregister`, `UninstallControls`, `AddinBeginShutdown`) are not called when the plugin is disabled. As such, we cannot close/dispose the first instances of these classes.

My question is, is there an event that we can use to register that the plugin has been disabled?

Thanks in advance for your response.

Best wishes,

Mark
Posted 20 May, 2019 04:18:55 Top
Andrei Smolin


Add-in Express team


Posts: 16098
Joined: 2006-05-11
Hello Mark,

I don't understand this scenario. It is my understanding that when you try to re-enable your add-in using the Disabled Items dialog, your add-in isn't loaded. That is, there's no instance of the add-in module at this moment.

Mark Wijnbergen writes:
My question is, is there an event that we can use to register that the plugin has been disabled?


No such event exists.

Just for completeness. I saw scenarios in which an add-in prevents Outlook from quitting. This looks as follows: your add-in receives the Outlook.Quit event and Add-in Express does everything required for your add-in to close. But, since another add-in prevents Outlook from closing, your add-in continues to receive events - and here a number of exceptions occur because Add-in Express doesn't expect these events. A way out of this is to turn that add-in down.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 May, 2019 04:40:01 Top
Mark Wijnbergen




Posts: 16
Joined: 2019-03-18
Hi Andrei,

Thanks for your quick response.

It is possible that on start-up Outlook detects that an enabled Add-in responds slowly, and it can in that case decide to disable that Add-in. In that case, the Add-in is already loaded and on re-enabling, the Add-in will be loaded for the second time.
Usually this can be prevented by certain registry keys but in some edge cases it might still occur.

Okay, we will find a workaround to make sure the Add-in isn't loaded multiple times.

Best wishes,

Mark
Posted 21 May, 2019 03:04:29 Top
Andrei Smolin


Add-in Express team


Posts: 16098
Joined: 2006-05-11
Hello Mark,

As far as I know, an Add-in Express add-in can't be marked as slow *at startup*. I've tested this by showing a message box in the AddinStartupComplete or AddinInitialize event and waiting for any amount of time.

If the issue is reproducible, please provide the scenario.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 May, 2019 03:39:57 Top
Mark Wijnbergen




Posts: 16
Joined: 2019-03-18
Hi Andrei,

We were marked as slow a few times, but I cannot reproduce the issue currently. If, in the future, I encounter this issue again and it is reproducible, I will let you know.

Best wishes,

Mark
Posted 21 May, 2019 05:46:48 Top
Andrei Smolin


Add-in Express team


Posts: 16098
Joined: 2006-05-11
Mark Wijnbergen writes:
We were marked as slow a few times, but I cannot reproduce the issue currently. If, in the future, I encounter this issue again and it is reproducible, I will let you know.


Slow at startup? Or slow when e.g. switching to a folder? Any details are of interest. If by the moment you find something, the topic gets closed (after 30 days of inactivity), write me to our support email address (see readme.txt): I'll reopen it.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 May, 2019 09:42:00 Top