VSTO "ThisApplication" module

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

VSTO "ThisApplication" module
 
Rick Koch




Posts: 172
Joined: 2006-09-05
The ADXModule is instantiated in the startup event of the VSTO ThisApplication module. Is it legal/okay/possible to maintain a reference back to that original module?

Right now it works like this:

My ThisApplication has these lines...

internal static ContactEvents ContactEvents;
internal static EmailEvents EmailEvents;
internal static AppointmentEvents AppointmentEvents;

...and in ThisApplication_Startup it has:
ADXModule.Initialize(this, typeof(ADXModule));

Then, in ADXModule.cs code, it has calls like this:
CosmosAddin.EmailEvents.SyncClick((Outlook.MailItem)item);

This is all static, so there's no handle from the ADX code to my original ThisApplication instance. In fact, the ADXModule has its own ThisApplication item.

Just trying to understand how this thing works. Every now and then when I encounter weird behavior I start to question the magic. If I understood the ADX model better I probably wouldn't be so distrustful.
Posted 12 Feb, 2007 11:00:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Hi Rick.

The fact is that the ThisApplication property of the ADXModule class is an instance of the ThisApplication class of VSTO. You just need to cast the reference to the ThisApplication class.



P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 13 Feb, 2007 10:21:44 Top