Hi,
I wanted to thank you for NetOffice, it is a truly fantastic piece of work.
I'm encountering the following error but it's very sporadic and has only happened a couple of times:
I wanted to thank you for NetOffice, it is a truly fantastic piece of work.
I'm encountering the following error but it's very sporadic and has only happened a couple of times:
Unable to cast COM object of type 'System.__ComObject' to interface type 'System.Runtime.InteropServices.ComTypes.IConnectionPoint'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B196B286-BAB4-101A-B69C-00AA00341D07}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
at NetOffice.SinkHelper.RemoveEventBinding(Boolean removeFromList)
at NetOffice.SinkHelper.Dispose()
at NetOffice.OutlookApi.Explorer.DisposeEventBridge()
at NetOffice.ComObject.Dispose(Boolean disposeEventBinding)
at NetOffice.ComObject.Dispose()
My code is:private void AddinShutdown()
{
if (this.outlookMailItem != null)
{
this.outlookMailItem.Dispose();
}
if (this.outlookExplorer != null)
{
this.outlookExplorer.Dispose();
}
if (this.outlookExplorers != null)
{
this.outlookExplorers.Dispose();
}
if (this.outlookInspector != null)
{
this.outlookInspector.Dispose();
}
if (this.outlookInspectors != null)
{
this.outlookInspectors.Dispose();
}
if (this.outlookApplication != null)
{
this.outlookApplication.Dispose();
}
if (this.ctpFactory != null)
{
this.ctpFactory.Dispose();
}
Have you encountered this before and am I doing anything wrong in my code to make this happen?