Omri Suissa
Posts: 137
Joined: 2011-10-17
|
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 |
|
Eugene Astafiev
Guest
|
Hi Omri,
Nope. Please read more about this in the When to release COM objects in Office add-ins developed in .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. |
|
Omri Suissa
Posts: 137
Joined: 2011-10-17
|
|