[Outlook] Dr. Watson

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

[Outlook] Dr. Watson
Outlook with bar generates Dr. Watson screens when closed. 
Workshop Alex


I have created a new Add-In project with two regular commandbars and one inspector commandbar. There's also one additional option screen to configure several options. There is no code behind these buttons yet.

This project was created after a few users complained about crashes after Outlook closed. In general, they reported several Dr. Watson screens. Errors that apparantly occur AFTER my project was unloaded from Outlook. (I know this because the original project was writing comments to a logfile and the last comments in the logfiles indicate that my project was unloaded.)

So I created this new Add-In project and wrote a little stresstest application. The Add-In had no functionality except for some buttons and options to display. The stresstest tool would just start the Outlook.exe process (using CreateProcess) and then wait for a minute before it sends a WM_QUIT message to the Outlook process. It would then wait for the process to close before it would restart Outlook again. Basically something like this:
  if CreateProcess( PChar( Outlook ), nil, nil, nil, True, 0, nil, PChar( CurrentFolder ), lpStartupInfo, lpProcessInformation ) then begin
    Sleep( 60*1000 );
    PostThreadMessage( lpProcessInformation.dwThreadId, WM_QUIT, 0, 0 );
    WaitForSingleObject( lpProcessInformation.hProcess, INFINITE );
until Forever;
The code is actually more complex than this but it should give an idea of what I'm trying.

Now the results on four testmachines, all running Windows 2000:
1) On a system with Outlook 2000, the stresstest detects Dr. Watson becoming active, even if the Add-in is not installed. Starting Outlook manually does not generate any Dr. Watson messages.
2) On a second system with Outlook 2000 the stresstest occasionaly generates a Dr. Watson message if the Add-in is installed but no messages without the add-in.
3) On a system with Outlook 2002 (Office XP) the stresstest detects no Dr. Watson messages.
4) On a system with Outlook 2003 the stresstest detects Dr. Watson messages about 80% of the time, if the add-in is installed. None without the add-in.

When testing manually, Outlook seems to be more stable.

I have absolutely no clue about where to look for this problem. I know that one of my testsystems is apparantly flawed since it doesn't like to co-operate with the stresstest. But on the other systems I only get problems when the add-in is installed.

FYI, the Dr. Watson logs an Exception number: c0000005 (access violation).
function: MsoSzStrStr
        30a62d2c e8c7dbe7ff       call    _MsoPvFree (308e08f8)
        30a62d31 ebd8             jmp     GetSelectedLbx+0xaf (30a6b90b)
        30a62d33 8b0d48b8d630     mov     ecx,[30d6b848]         ds:30d6b848=00000000
        30a62d39 55               push    ebp
        30a62d3a 56               push    esi
        30a62d3b 8b74240c         mov     esi,[esp+0xc]          ss:00af9ceb=11003d00
        30a62d3f 33ed             xor     ebp,ebp
        30a62d41 57               push    edi
        30a62d42 837e78ff         cmp  dword ptr [esi+0x78],0xff ds:0190c19a=????????
        30a62d46 0f8521f80700     jne     DeleteListBoxEntry+0x502ee (30ae256d)
FAULT ->30a62d4c 396914           cmp     [ecx+0x14],ebp         ds:00a89ee6=????????
        30a62d4f 7572             jnz     GetSelectedLbx+0x67 (30a6b8c3)
        30a62d51 8b462c           mov     eax,[esi+0x2c]         ds:0190c19a=????????
        30a62d54 3bc5             cmp     eax,ebp
        30a62d56 740c             jz      MsoFindNextFileW+0xf6 (30a66664)
        30a62d58 39a8c0010000     cmp     [eax+0x1c0],ebp        ds:00e82474=00e81554
        30a62d5e 0f8513f80700     jne     DeleteListBoxEntry+0x502f8 (30ae2577)
        30a62d64 8bce             mov     ecx,esi
        30a62d66 e8c2ceebff       call    MsoFLoadBStrip+0x25d (3091fc2d)
        30a62d6b 8bce             mov     ecx,esi
        30a62d6d e881fcffff       call    MsoSzStrStr+0x43f (30a629f3)
        30a62d72 8bbec0000000     mov     edi,[esi+0xc0]         ds:00e82374=00e82398
I can provide the whole logfile if you like, all 364+ KB. I can also provide the source of the stresstest tool I used but it's not very user-friendly.
Posted 23 Nov, 2005 10:16:59 Top
Eugene Starostin


Hello Alex,

Thank you for your information. However, could you please let us know what our product have you used? Please include build information.
Posted 23 Nov, 2005 10:25:00 Top
Eugene Starostin



I have just reread your messange. It seems you don't release some Outlook interfaces you use in the add-in. So, we need your source code to help you. Also, please test our sample add-ins included in all our distributives. Thank you.
Posted 23 Nov, 2005 10:27:52 Top
Wim W.A. ten Brink

Workshop Alex

Posts: 30
Joined: 2005-11-23
Build information:
Add-in Express VCL Edition Version 2.3 build 236.
Security Manager Component version as DLL.

I will test with one of the sample add-ins just to make sure.

About the sourcecode, I started with a new add-in project, dropped two TadxCommandBar components and one TadxOlInspectorCommandBar on it. A couple of buttons and one dropdown list on these bars with some events linked to them. (No code in those event handlers, just a comment to prevent Delphi from removing them.) One property page is added too. For this property page I am using some components from Developers Express but that should not matter. (My stresstest isn't calling it.)

I will send you the sourcecode of this project in a ZIP file called Bridge.zip and the sourcecode of the stresstool I wrote (Stress.zip) in a separate email. I'm not sure if it helps since this problem seems more related to Outlook than to the Add-in. The sourcecode was generated in Delphi 5 because the original project is based on Delphi 5, but it should work in other Delphi versions too.

My main concern is that two systems seem less stable when the add-in is used.
With kind regards,
\/\//\ Workshop Alex
Posted 23 Nov, 2005 11:22:37 Top
Dmitry Kostochko

Add-in Express team

Posts: 2875
Joined: 2004-04-05
Hi Wim,

I have just received your projects, thanks. I need some time for testing. I will let you know about the results as soon as possible.

Posted 23 Nov, 2005 12:10:44 Top
Wim W.A. ten Brink

Workshop Alex

Posts: 30
Joined: 2005-11-23
Okay, thanks.

As said before, it is unclear to me if this is just a problem on the systems that I've used for testing or if this is a problem within the Afalina components. Right now, I am creating several virtual machines with different versions of Windows and Outlook just to create a reliable test environment. This will take me some time too but in the end it will clear up the problems sooner or later.

It's a weird problem that I'm having since one system with Outlook 2002 has no problems while two other systems (with 2000 and 2003) both seem to have problems only when the dummy add-in is installed.

I will also test my 2003 system (which generates the most problems) with one of the test projects for Outlook. Just to see if the system has problems with that add-in too.
With kind regards,
\/\//\ Workshop Alex
Posted 24 Nov, 2005 04:56:06 Top
Wim W.A. ten Brink

Workshop Alex

Posts: 30
Joined: 2005-11-23
Microsoft Office Outlook has encountered a problem and needs to close. We are sorry for the inconvenience.
This is the Dr. Watson (for Office) message that I get on Windows 2000 with Outlook 2003. This occurred after Outlook was started by my stresstool for the 32th time. Until then there were no problems. And again with the 35th run.

I have compiled the demo project 'MyFirstOlAddIn' with Delphi 5 and used this as the add-in for Outlook. No other add-ins were installed. Without the add-in I don't get any of these problems on this system. So for whatever reason the combination of the Afalina components with Outlook 2003 is generating problems on this single system.
Or maybe it's something in Delphi 5 that causes this error and should I use Delphi 7 instead to compile this demo. I will run this demo again after compiling the source in Delphi 7. If the Delphi 7 version does not cause any of these problems then I will have to upgrade my original project to Delphi 7. Otherwise there is something interesting going on between the Afalina components and my computer system.

Or maybe it's just my stresstool that is buggy. However, I also tested Outlook manually and managed to get the same Dr. Watson message after a few attempts.

[Update] After building the same demo in Delphi 7 I started testing again. Up to 21 times everything went okay. The 22th and 23th times however ended in a Dr. Watson notification on my system.
With kind regards,
\/\//\ Workshop Alex
Posted 24 Nov, 2005 05:59:55 Top
Dmitry Kostochko

Add-in Express team

Posts: 2875
Joined: 2004-04-05
Hi Wim,

I have first results from your stress tool:
<Overview Name="Total" Crash="0" DrWatson="0" Detected="0" Total="106" />
<Overview Name="With" Crash="0" DrWatson="0" Detected="0" Total="100" />
<Overview Name="Without" Crash="0" DrWatson="0" Detected="0" Total="6" />

The add-in was compiled with:
Delphi 5 Ent Update Pack 1
Add-in Express VCL
Outlook Security Manager 1.4

Tested under:
Windows XP Prof SP2
Outlook 2003 SP2

Note, I have removed some units I don't have from your dpr file. The list of these units was sent to you by email.

The only difference I see is the operating system. At the moment I am installing Windows 2000 on one of our test PCs and will try to test your project under Win2000.

Posted 24 Nov, 2005 06:55:56 Top
Dmitry Kostochko

Add-in Express team

Posts: 2875
Joined: 2004-04-05
Hello Wim,

Thank you very much from all the ADX Team for helping us to find the bug. Really appreciated.

To all our forum subscribers:
The bug was found and fixed. We are planning to publish a new build of Add-in Express VCL Edition next week.

Posted 25 Nov, 2005 09:17:04 Top