[Outlookbar] Possible problems with webviews?

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

[Outlookbar] Possible problems with webviews?
 
Wim W.A. ten Brink


Workshop Alex


Posts: 30
Joined: 2005-11-23
It's a situation that I've only managed to get on a single system. I have an Outlook Addin created with the Add-in Express. I also has a folder with a webview enabled. (Which you can create by selecting a folder, rightclick to go to properties, go to home page tab, enter an URL and check the checkbox.)

Running Windows 2000 with Outlook 2003, all with latest service packs.

When I start Outlook without my Outlookbar, no problems.

When I start Outlook with the Outlookbar and close it, no problem.

When I start Outlook with the Outlookbar and select the folder with the webview, then close Outlook, I get a Dr. Watson screen.

When I start Outlook with the Outlookbar and select the folder with the webview, then select another folder again, then close Outlook, I get a Dr. Watson screen.

If I test the same on another system with similar configuration, no problems.

This problem is driving me a bit crazy and I just blame my own system for this weird behaviour. Then again, since it only happens on one of the four systems that I've used for testing, I am going to just ignore this problem for now.

All I want to know is if someone knows about possible conflicts between webviews and the Add-in express?
With kind regards,
\/\//\ Workshop Alex
Posted 01 Mar, 2006 10:31:00 Top
Dmitry Kostochko


Add-in Express team


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

We have never been reported about such strange behavior before. Does this folder with a web-view create your add-in? Does the web-view contain any ActiveX objects? Did you try switching to the standard Personal Folders web-view? What happens in this case?

Posted 01 Mar, 2006 10:44:40 Top
Wim W.A. ten Brink


Workshop Alex


Posts: 30
Joined: 2005-11-23
No, my add-in is operating only in the main bar of Outlook and on the contact forms. The add-in does access some folders on start-up to synchronise certain contact folders with it's internal contacts list but the folder with the webview is not accessed.

I have tried to check to see with which pages Outlook crashes. It crashes with http://www.google.com and our own website, but not with this forum for whatever reason, so it's a bit unpredictable. (Actually, while I am typing this, I am typing this in a webview in Outlook!)
The personal folders webview is stable too. So are several other websites. And it doesn't seem to matter where the folder with the webview is located or what kind of folder it is, it will cause a crash when Outlook is closed.

I have rebooted my system but even then it continues to show this behaviour. I can try and do a "Detect and Repair" on Outlook and compact the *.PST's that I use to see if that fixes the problem but my fear is that if I do fix it that way, I still won't know what caused the problem.
With kind regards,
\/\//\ Workshop Alex
Posted 02 Mar, 2006 03:35:53 Top
Dmitry Kostochko


Add-in Express team


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

I am afraid I can't advise you anything of value. As I said earlier this is a strange situation. BTW, I have just tested the Outlook 2003 web-view with google.com and don't see any crashes. Can I ask you to send me your add-in for testing?

Posted 02 Mar, 2006 07:48:52 Top
Wim W.A. ten Brink


Workshop Alex


Posts: 30
Joined: 2005-11-23
Hi Dmitry,
My add-in requires some additional hardware and software in your system which it needs to work correctly so I'm afraid it's not very useful to send you the binary file. (Or the sourcecode.)
I have tested it on several other systems now and the crash seems specific for my system so I will just ignore it for now. It's just weird that Outlook behaves normal if my Outlookbar is not installed. Also weird that I can visit this site in a webview and even post a message, then close Outlook with no problems while a much simpler site like Google will make it crash.
(Virusscan indicated my system is clean. No Adware either.)
With kind regards,
\/\//\ Workshop Alex
Posted 03 Mar, 2006 03:28:05 Top
Wim W.A. ten Brink


Workshop Alex


Posts: 30
Joined: 2005-11-23
Additional note: after rewriting one unit that retrieves some configuration data, the problem seems to be solved again. I can now access Google without any problems from Outlook.
Possible cause, which is just a guess: when retrieving or saving configuration data, I was accessing some of the Outlook folders (but none with a webview) and perhaps these folders weren't cleaned up correctly afterwards. I have moved the related code to the retrieval of the folder data to a separate component and made sure it was freed at the appropiate moment, which seems to have solved the problem.

Actually, my Outlookbar seems more stable now after this fix, although it will need some further testing. So valuable lesson: if you work with Outlook and use some of Outlooks resources, make sure you free them as soon as you don't need them anymore.
With kind regards,
\/\//\ Workshop Alex
Posted 03 Mar, 2006 03:38:42 Top
Dmitry Kostochko


Add-in Express team


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

I am glad you found and fixed the bug. Good luck with your project.

Posted 06 Mar, 2006 07:04:15 Top
Wim W.A. ten Brink


Workshop Alex


Posts: 30
Joined: 2005-11-23
I can give one very good advise here. One of the things I did was walking through the folders and subfolders to find any contact folder. To keep this list, I used a dynamic array of MAPIFolder objects and just added any folder that I found to this list. (Non-recursively, btw.) Apparantly, this eats up quite a few resources in Outlook and slows things down.
So I replaced it with a dynamic array of record, where the record contains the EntryID and FolderID (and some other information) and I am using this array now to get the folders that I am interested in by using the "adxCoOutlookBridge.OutlookApp.GetNamespace( 'MAPI' ).GetFolderFromID( EntryID, StoreID );" method. This seems slower at first, but it actually speeds up processing of folder lists. (Possibly Outlook is pooling these folder objects internally to speed up retrieving folder items.)

So my advise is simple: avoid storing Outlook items since it eats up resources. Store the EntryID/StoreID instead, allowing you to requery the item when required.

Further testing showed that my Outlookbar went down from a crash-percentage of around 30% to about 5% when closing Outlook. Which is still bothering me, but acceptable for now.

Outlook still crashes after visiting some sites in the webview, though. But only on a single system, namely the system I use for development. No other system has this problem. (Tested it on a dozen systems now.) I therefore assume this is a bug in my Outlook installation and not related to the add-in.

To be more precise, it crashes after the OnAddInFinalize event of my bar is triggered, and before any finalize handlers of my units are called. But only on a single system, after viewing some websites.
With kind regards,
\/\//\ Workshop Alex
Posted 07 Mar, 2006 06:35:41 Top
Dmitry Kostochko


Add-in Express team


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

Thank you for your observations and valuable advice.

Posted 07 Mar, 2006 11:49:55 Top
Wim W.A. ten Brink


Workshop Alex


Posts: 30
Joined: 2005-11-23
After some further experimenting, I discovered that the problem is related to webviews of pages containing JavaScript. The following single-liner webpage will generate the problem in my Outlook version:

<html><body><script type="text/javascript"></script></body></html>

Saving above page as e.g. index.htm and then set the properties of one folder to point to this webpage on your disk. (Say, set the url to C:\webpage\index.htm and enable the webview.)

When Outlook displayed this page in a webview while my add-in is also running, Outlook will crash when I exit Outlook. Without my add-in, it just closes without any problems.

Pages without Javascript don't have any problems.
With kind regards,
\/\//\ Workshop Alex
Posted 08 Mar, 2006 04:36:09 Top