adxieContextMenuCommandItem OnClick

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

adxieContextMenuCommandItem OnClick
 
Omri Suissa


Guest


Hi,
When using adxieContextMenuCommandItem OnClick i should release the com object of the element?


private void adxieContextMenuCommandItem1_OnClick(object sender, object htmlElement)
{
...
Marshal.ReleaseComObject(htmlElement);
}


Thanks,
Omri
Posted 19 Jul, 2012 06:05:43 Top
Eugene Astafiev


Guest


Hi Omri,

Nope. Please read more about this in the http://www.add-in-express.com/creating-addins-blog/2008/10/30/releasing-office-objects-net/ article on our technical blog. Pay special attention to the Should I release explorer in the following VB.NET code question. The answer is:

Please never release COM objects passed in parameters of Add-in Express events. Add-in Express relies on the state of every COM object passed to you in event parameters. Usually, such parameters are released just after the event handler finishes. But there are numerous exceptions. Just recently, we saw how a customer released the inspector passed to the NewInspector handler in the Dynamic Command Bar and Controls in Outlook sample add-in. This caused adding command bars to an explorer window instead of inspector?Â?Ð?és one. Bizarre, this happened in a certain scenario only.
Posted 19 Jul, 2012 06:31:29 Top
Omri Suissa


Guest


Thanks
Posted 01 Aug, 2012 02:16:37 Top
Eugene Astafiev


Guest


You are welcome, Omri!
Posted 01 Aug, 2012 03:00:47 Top