Clean up before Close

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

Clean up before Close
How to clean up AddinModules and SmartTagmodules 
Jacco van der Pol

Posts: 30
Joined: 2005-09-13

I'm having trouble understanding what I have to clear up manually when closing word.

I have a SmartTagmodule & Addin module combined in one project. They are connected to eachother (Used example from this forum)

It's my smarttagmodule which causes the problem. If I comment al the actions, shut down performs allright.

1. I know I should clean up com objects, but what else?
2. How do I clean up my smarttagmodule (which event should I trap)?
3. Which goes first, the addin or the smarttagmodule?

Posted 08 Dec, 2005 15:18:28 Top
Sergey Grischenko

Add-in Express team

Posts: 7205
Joined: 2004-07-05
Hi Jacco.

1. You need to clean up all objects which you get from the host app if
you are not going to use them anymore. However you shouldn't clean up
objects which you get in ADX events. ADX will do it itself.
2. You can use the RecognizerFinalize event to clean up your objects.
However, for some reason this event doesn't occur in Word. In this
situation I would advise you not to store any Word interfaces in the
local fields of the smarttag module and clean them up at once in the
events of the ADXSmartTag component.
3. Actually the addin should be cleaned first.
You can use the AddinBeginShutdown event handler to clean your
Posted 09 Dec, 2005 10:58:26 Top
Jacco van der Pol

Posts: 30
Joined: 2005-09-13
Thanks Sergey, this makes things clear.

Posted 11 Dec, 2005 12:39:27 Top