WebViewPane - startup speed

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

WebViewPane - startup speed
 
Dominik Jeske




Posts: 28
Joined: 2011-10-13
I'm using this method to show something in WebViewPane

private void RefreshCurrentFolder()
{
_refreshCurrentFolderExecuting = true;
try
{
Outlook.Explorer activeExplorer = (OutlookApp as Outlook._Application).ActiveExplorer();
Outlook.MAPIFolder currentFolder = activeExplorer.CurrentFolder;
Outlook.NameSpace nameSpace = (OutlookApp as Outlook._Application).GetNamespace("MAPI");
Outlook.MAPIFolder outboxFolder = nameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox);
try
{
SetExplorerFolder(activeExplorer, outboxFolder);
System.Windows.Forms.Application.DoEvents();
SetExplorerFolder(activeExplorer, currentFolder);
}
finally
{
if (nameSpace != null)
Marshal.ReleaseComObject(nameSpace);
if (currentFolder != null)
Marshal.ReleaseComObject(currentFolder);
if (outboxFolder != null)
Marshal.ReleaseComObject(outboxFolder);
if (activeExplorer != null)
Marshal.ReleaseComObject(activeExplorer);
}
}
finally
{
_refreshCurrentFolderExecuting = false;
}
}

but when I'm executing this there is 1-1.5 second lag before show even simple form. Is there any method quicker then this

My system: Windows 7 x64, Office 2010 x86
Posted 14 Dec, 2011 04:45:19 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dominik,

Could you please send a newly created sample add-in project which can reproduce the issue to the support e-mail address (see readme.txt for details)? I will test it on my PC with Office 2010 and Windows 7.
.NET, Extended MAPI, Windows Phone & RT
Posted 14 Dec, 2011 05:41:57 Top
Dominik Jeske




Posts: 28
Joined: 2011-10-13
hmm... on clean sample it is quicker... I guess I have some event somewhere witch slows down folder switching... I will search for it
Posted 14 Dec, 2011 07:15:15 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dominik,

Please keep me notified. Anyway, if you are able to reproduce the issue with a newly created add-in please send it to us for testing.
.NET, Extended MAPI, Windows Phone & RT
Posted 14 Dec, 2011 07:25:57 Top
Dominik Jeske




Posts: 28
Joined: 2011-10-13
I think that long load of the form is caused by initialization of the form (InitializeComponent). I set this to OneInstanceForAllFolders but it appears that in WebViewPane new instance of the form is always created. Is there any way to force one instance in this view?
Posted 14 Dec, 2011 08:23:04 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dominik,

If you set the Cached property to the OneInstanceForAllFolders value a new form is not created each time. We have just checked this. Instead, please check out the Activated, ADXBeforeFormShow, AfterFormShow and etc. event handlers of your add-in. Also please pay special attention to the Outlook events such as ExplorerFolderSwitch (see the list of events of the ADXOutlookAppEvents components). Finally, you may try to comment all the code in the specified event handlers and let me know whether it improves the time of loading.
.NET, Extended MAPI, Windows Phone & RT
Posted 14 Dec, 2011 09:09:45 Top
Dominik Jeske




Posts: 28
Joined: 2011-10-13
OK I have missed some code in my description. In ADXBeforeFolderSwitchEx
I set current folder to its defaults because I want user to have access to normal folders after switching from my module to other folders and come back(my solution - http://tfs.exaco.pl/xxx/MyAddin5.zip). And question arise if I can use same instance when I set form again to some folder because in my solution Im always getting new instance.
Posted 15 Dec, 2011 07:06:03 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dominik,

Thank you for providing me with a sample add-in project. I will test it in one of my virtual PCs and let you know the results tomorrow.
.NET, Extended MAPI, Windows Phone & RT
Posted 15 Dec, 2011 10:16:36 Top
Dominik Jeske




Posts: 28
Joined: 2011-10-13
I decided to create dedicated folder for each form - then I have caching working
Posted 19 Dec, 2011 04:03:59 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dominik,

I have tested your sample add-in project on my PC with Outlook 2010 and couldn't reproduce the delay. Please take a look at the How to switch between the standard Outlook explorer view and your custom C# form sample add-in project which is available in the HOWTO section of our web site. Does it work as expected?

Did you try to comment the code from the ADXBeforeFolderSwitchEx event handler? Does it help?
.NET, Extended MAPI, Windows Phone & RT
Posted 19 Dec, 2011 07:17:30 Top