Add-in crashes Outlook when double-clicking on email in inbox

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

Add-in crashes Outlook when double-clicking on email in inbox
When I double-click on an email in the Outlook inbox, Outlook crashes. 
Roberto Esguerra




Posts: 22
Joined: 2022-01-31
I must be overlooking something basic. When I double-click on an email in the Outlook inbox, Outlook crashes. Not every time, but regularly. This is on Outlook 2019 x64.

I know it's the add-in I'm developing because this crash doesn't happen when the add-in isn't installed.

I'm trying to intercept all paths to Reply All.
Posted 15 Jun, 2022 01:54:53 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Hello Roberto,

What call causes the crash?

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Jun, 2022 02:51:17 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Is there a call stack? Does your add-in handle opening an inspector window? Selecting an email? The methods handling these events are good candidates for investigating the issue. Do you implement logging in your code?

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Jun, 2022 02:55:07 Top
Roberto Esguerra




Posts: 22
Joined: 2022-01-31
Andrei,

I'm not sure what call causes the crash. I know it happens after I double-click on an email. I'm putting in code to log which functions get called.
Posted 15 Jun, 2022 03:31:49 Top
Roberto Esguerra




Posts: 22
Joined: 2022-01-31
My add-in does have a handler for inspector activation, adxOutlookEvents_InspectorActivate.
Posted 15 Jun, 2022 03:33:31 Top
Roberto Esguerra




Posts: 22
Joined: 2022-01-31
Don't have a call stack, but I believe I've isolated the function where the crash is triggered. If I single click on one email after another in the inbox, after a few emails, Outlook crashes. According to my log file, the Item_Load event handler is called after each click on an email. This is the code for the event handler:


        private void adxOutlookAppEvents_ItemLoad(object sender, object item) {
            File.AppendAllText(m_debugOutputFilename, fixedFormatMessage("adxOutlookAppEvents_ItemLoad"));
            if (itemEvents == null) return;

            Outlook.MailItem mailItem = item as Outlook.MailItem;
            if (mailItem != null) {
                if (itemEvents.IsConnected) itemEvents.RemoveConnection();
                itemEvents.ConnectTo(item, true);
            }
        }


What am I doing wrong?
Posted 15 Jun, 2022 04:47:34 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
The code looks correct. What call crashes Outlook? Check if you have anything of value in Events Viewer. Also, check if the issue is reproducible with all other add-ins turned off.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Jun, 2022 04:55:05 Top
Roberto Esguerra




Posts: 22
Joined: 2022-01-31
The issue is not reproducible when I turn off all the other add-ins. We have quite a few in use.

The Outlook crashes are recorded in Event Viewer, but the messages are not useful. Here is one:

Faulting application name: OUTLOOK.EXE, version: 16.0.10386.20017, time stamp: 0x6269c506
Faulting module name: ucrtbase.dll, version: 10.0.19041.789, time stamp: 0x2bd748bf
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process id: 0x6fac
Faulting application start time: 0x01d8809a67c0ed2c
Faulting application path: C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 1a1752c4-2145-411f-8f1d-61ba8b8b1f68
Faulting package full name:
Faulting package-relative application ID:
Posted 15 Jun, 2022 05:17:27 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Turn on other add-ins one by one to find the offending add-in. If it is a Microsoft add-in, turn it off. If it is a third-party add-in, try to get a newer add-in version.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Jun, 2022 05:21:31 Top
Roberto Esguerra




Posts: 22
Joined: 2022-01-31
Objectively, your suggested course of action makes sense. But even if I find the other add-in that clashes with the one I'm writing, it's not up to me to have the other add-in disabled until we can get a newer version. And since the one I'm developing is under our control, the finger will inevitably point to me.

Assuming I identify the other add-in, what can I do with my add-in to avoid the crashing?
Posted 15 Jun, 2022 05:45:41 Top