Outlook issue with HostType (results in ohaUnknown)

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

Outlook issue with HostType (results in ohaUnknown)
 
Subscribe
Alexander de Man




Posts: 31
Joined: 2007-05-03
Hello,

I'm having a strange issue with our add-in running in Outlook 2010 in combination with another 3rd party Add-in-Express add-in. In some cases AddinModule.HostType returns ohaUnknown during startup. I can sort of reproduce it by starting Outlook when an old Outlook process is still shutting down. It doesn't happen all the time during my tests, but around 1 in 4 times.

Do you have an explanation why AddinModule.HostType isn't always properly initialized when user code is executed?
Posted 19 Dec, 2018 10:09:56 Top
Andrei Smolin


Add-in Express team


Posts: 15595
Joined: 2006-05-11
Hello Alexander,

In what event do you retrieve AddinModule.HostType?

Are there any specific details about the old Outlook process before it is closed? Or, you just start Outlook and close it, start and close it again? No floating forms, dialog messages, inspectors open Office applications or Windows Explorer, whatever?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Dec, 2018 04:52:16 Top
Alexander de Man




Posts: 31
Joined: 2007-05-03
Hello Andrei,

Thanks for your response. I did some testing to see what event originates the exception and I found some differences in events that are triggered during startup:

Crash:
[10:45:50.0515 INF] SetupAddinModule "ohaOutlook"
[10:45:52.1683 INF] "OutlookExplorerSelectionChange" "ohaOutlook"
[10:45:55.7808 INF] "OutlookExplorerSelectionChange" "ohaOutlook"
[10:46:17.9233 INF] "OutlookExplorerClose" "ohaOutlook"
[10:46:24.3256 INF] "OutlookExplorerActivate" "ohaUnknown"
[10:46:24.5777 INF] "OutlookExplorerDeactivate" "ohaUnknown"
[10:46:24.8467 INF] "OutlookExplorerActivate" "ohaUnknown"

Normal:
[10:51:08.9861 INF] SetupAddinModule "ohaOutlook"
[10:51:11.0815 INF] "OutlookExplorerSelectionChange" "ohaOutlook"
[10:51:11.7036 INF] "OutlookExplorerSelectionChange" "ohaOutlook"
[10:51:14.5292 INF] "OutlookExplorerDeactivate" "ohaOutlook"

As you can see an ExplorerClose events gets triggered and in events after that the HostType is ohaUnknown. It could be that the ExplorerClose is from the old process. I will cook another build that show the process id for each event.

The steps I use are indeed just start Outlook. Wait a bit until everything seems to be loaded. Close Outlook and try to start it again when it's still "closing" (process is still running), but the taskbar icon is clickable again. I do have the built in reminder window active.

Note, my customer is also getting this error but not with these steps. However, I'm not able to find a way to reproduce it any other way so far.
Posted 20 Dec, 2018 06:19:48 Top
Andrei Smolin


Add-in Express team


Posts: 15595
Joined: 2006-05-11
Hello Alexander,

So, you get an exception. In what event? In what event do you retrieve AddinModule.HostType? I try to understand what you see, please.

Alexander de Man writes:
I do have the built in reminder window active.


Are you saying that an Outlook window (reminder) is still open (while Outlook closes) and you start another Outlook instance by clicking the shortcut starting Outlook?

Can I see these loader logs created when the first and the second Outlook applications instance start?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Dec, 2018 08:33:21 Top
Alexander de Man




Posts: 31
Joined: 2007-05-03
Hello Andrei,

The exception is thrown in our code (sorry if that wasn't clear). We have an add-in that works in multiple Office applications and we use the HostType to determine the correct (generic) layer that interacts with the Office application. Because HostType results in ohaUnknown we get a NullReferenceException when we try to access this generic layer.

The root event is ExplorerActivate, but as my log show it only happens when an ExplorerClose gets triggered just before. I can confirm that the ExplorerClose event is from the same process as the newly started Outlook.


Are you saying that an Outlook window (reminder) is still open (while Outlook closes) and you start another Outlook instance by clicking the shortcut starting Outlook?

No, that window isn't visible anymore.


Can I see these loader logs created when the first and the second Outlook applications instance start?

I've tried doing that, but it seems that the first instance still has a open lock and the file doesn't get updated. I've tried to kill the lock after the first instance was ready, but again nothing was added.

I've created a screenrecording that I just sent to your support mail. I've also included the adxloader.log with that mail.

Thanks again.
Posted 21 Dec, 2018 05:18:23 Top
Andrei Smolin


Add-in Express team


Posts: 15595
Joined: 2006-05-11
Hello Alexander,

Thank you! Great! I've passed the files to our guys. I'm not sure when we will look in this, though. To create a reference point, I've added this issue to our bug-tracking DB under #14309.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Dec, 2018 06:03:08 Top
Alexander de Man




Posts: 31
Joined: 2007-05-03
Hello Alexander,

Thanks, I will be out of the office until January 14th, so you have some time.. :) Enjoy the holidays!

Regards,
Alexander
Posted 21 Dec, 2018 06:59:05 Top
Andrei Smolin


Add-in Express team


Posts: 15595
Joined: 2006-05-11
Hello Alexander,

Enjoy the holidays, too!

When you return, I'll need to know the exact build of Office 2010 used on that machine; I can't reproduce the issue using Outlook 2010 build 14.0.7153.5000 (32bit). Does the issue goes away if you turn all other COM add-ins off?

Also, I have a project that I'd like you to test on that machine.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Dec, 2018 08:51:26 Top
Alexander de Man




Posts: 31
Joined: 2007-05-03
Hello Andrei,

That system uses build 14.0.7181.5000 (32-bit). I've disabled all other add-ins and so far I'm unable to reproduce the issue. There were 9(!) addins enabled on that system. Does it help if I try to exclude add-ins?

If you want me to test anything, please let me know.

Thanks,
Alexander
Posted 15 Jan, 2019 03:35:35 Top
Andrei Smolin


Add-in Express team


Posts: 15595
Joined: 2006-05-11
Hello Alexander,

Alexander de Man writes:
Does it help if I try to exclude add-ins?


Possibly, yes. In fact, if we are unable to reproduce and fix the issue, your only way out of this would be to turn that add-in off.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Jan, 2019 09:24:00 Top