WebViewPane - startup speed

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

WebViewPane - startup speed
 
Dominik Jeske


Guest


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


Guest


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.
Posted 14 Dec, 2011 05:41:57 Top
Dominik Jeske


Guest


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


Guest


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.
Posted 14 Dec, 2011 07:25:57 Top
Dominik Jeske


Guest


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


Guest


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.
Posted 14 Dec, 2011 09:09:45 Top
Dominik Jeske


Guest


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 I?Â?Ð?ém always getting new instance.
Posted 15 Dec, 2011 07:06:03 Top
Eugene Astafiev


Guest


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.
Posted 15 Dec, 2011 10:16:36 Top
Dominik Jeske


Guest


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


Guest


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 http://www.add-in-express.com/support/addin-c-sharp.php#form-regions sample add-in project which is available in the http://www.add-in-express.com/support/add-in-express-howto.php 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?
Posted 19 Dec, 2011 07:17:30 Top