Paul Cross
Guest
|
Hi,
I'm using the ADXMAPIStoreAccessor with asynchronous notifications - create in the following way:
ADXMAPIStoreAccessor mapiStoreAccessor = new ADXMAPIStoreAccessor { SupportedStoreEvents = ADXMsgStoreEvents.CriticalError | ADXMsgStoreEvents.NewMail | ADXMsgStoreEvents.ObjectCreated | ADXMsgStoreEvents.ObjectMoved };
mapiStoreAccessor.Initialize(false);
mapiStoreAccessor.AsyncInterval = 1000;
mapiStoreAccessor.AsyncNotifications = true;
If I exit Outlook after clicking Send/Receive (without waiting for Send/Receive to complete) I occasionally receive the error below (trapped in OnCurrentDomainUnhandledException).
System.NullReferenceException: Object reference not set to an instance of an object.
at AddinExpress.MAPI.ADXMAPIStoreAccessor.AbortHasRequested(ArrayList arrList)
at AddinExpress.MAPI.ADXMAPIStoreAccessor.ThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
.NET Reflector shows that the AbortHasRequested method has no try/catch
private void AbortHasRequested(ArrayList arrList)
{
if (arrList.Count > 0)
{
arrList.Clear();
}
Monitor.Enter(this._notificationsList.SyncRoot);
if (this._notificationsList.Count > 0)
{
this._notificationsList.Clear();
}
Monitor.Exit(this._notificationsList.SyncRoot);
}
This error does not occur if I use ADXMAPIStoreAccessor with synchronous notifications...
Any thoughts as to possible workarounds (other than catching the NullReferenceException in OnCurrentDomainUnhandledException)?
Thanks,
Paul |
|
Eugene Astafiev
Guest
|
|
Paul Cross
Guest
|
Thanks Eugene, I'll try the new build tonight. |
|