ADXOlForm instantiation failure

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

ADXOlForm instantiation failure
 
nwein




Posts: 577
Joined: 2011-03-28
I just received an error log from one of our users. We log all exceptions using
AddinExpress.OL.Log.AddException

So as to get better understanding of what's going on.
I've sent the full log to your support email (I believe it would have been to big for this forum).
Looking at the errors it seems like there was a failure in an ImageList instantiation which resulted in failure to create ADXOl forms. Not sure how this happen.
This is using ADX version 8.4 on Outlook 2010 32-bit on Windows 7 both Office and Windows updated with latest patches.


On an unrelated topic (though reported by the same user after restating their Outlook), I got the old "COM object that has been separated from its underlying RCW cannot be used" error in the my OutlookEvents.SyncEnd on the first line, i.e. I wasn't doing anything with it just yet:
private void OutlookEventsSyncEnd(object sender, object syncObject)
{
	try
	{
		var o = syncObject as SyncObject; // <-- Threw exception here
		if (o != null)
		{
			//...
		}		
	}
	catch (Exception ex)
	{
		//...
	}	
}
Posted 27 Feb, 2017 12:16:35 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Nir,

Weird.

Will the issue persist if you reinstall the add-in? Create a new installer? A new build? Maybe the resource file is broken? First, check if the ImageList component works correctly for you at the design time? You can alos check if installing the add-in locally produces the issue.

If the issue persists, could you please send use the Outlook-related and ADXOlForm-related parts of the code of the form?

nwein writes:
I got the old "COM object that has been separated from its underlying RCW cannot be used" error in the my OutlookEvents.SyncEnd on the first line, i.e. I wasn't doing anything with it just yet


Do you use DoEvents, async things, or background threads in the code of your add-in?


Andrei Smolin
Add-in Express Team Leader
Posted 28 Feb, 2017 10:42:13 Top
nwein




Posts: 577
Joined: 2011-03-28
Thanks for the reply Andrei,
I believe the (first) issue does not persist, we have many users using the same add-in (including the one who had the issue) and this was the first time I've seen this. After restarting the host the user didn't get that error anymore.
I can't see how anything would change with the resource file between runs. Maybe i'll leave this as a one off unless I can reproduce it continually.
On that same topic - is there any way to re-use ImageMSO in ADXOlForms? I mean, I have my image list for the images in the form but it would be much cleaner (and reduce the need to use image lists) if I could "ride" the ImageMSO, similar to how i'm doing it in the ribbon (I know ribbon and forms are different but thought i'd ask anyway).

As for the second issue, yes I do have async calls in the main module, granted, these do not interact with the office object model in any way. How can that be an issue in your mind?
Posted 28 Feb, 2017 11:03:40 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
nwein writes:
On that same topic - is there any way to re-use ImageMSO in ADXOlForms?


See Commandbars.GetImageMso().

nwein writes:
As for the second issue, yes I do have async calls in the main module, granted, these do not interact with the office object model in any way. How can that be an issue in your mind?


I wonder if you invoke an await operator with ConfigureAwait(false). It results in an asynchronous operation executing in the context that may differ from the context, in which the operation was originally invoked. The context change may be almost anything: a window created/shown/hidden/destroyed, the selection changed, etc. I strongly believe that using SendMessage/OnSendMessage and performing all activity while handling a custom message is far safer than using async/await.


Andrei Smolin
Add-in Express Team Leader
Posted 01 Mar, 2017 07:22:19 Top