none
In an Office Addin must call remove and dispose on the SmartTagCollection before shutdown? RRS feed

  • Question

  • I am coding with VSTO Smarttags in Application-Level Office 2007 Addins.

    I notice that the SmartTagsCollection Interface here has a method to Remove and a method to Dispose.

    When should these be called?

    I have noticed that by the time the ThisAddIn_Shutdown is called the Collection no longer has the smarttag (count of collection is 0) in it and Dispose causes an execption.

    Tuesday, April 1, 2014 6:03 PM

Answers

  • Hi,

    Dispose is inherited from IDisposable.

    >> In an Office Addin must call remove and dispose on the SmartTagCollection before shutdown?<<

    Dispose method is used to Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Unmanaged resources could not be released by GC, so we should release it explicitly.

    Based on your description, I think the Dispose method had already been called by the Framework before shutting down.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 2, 2014 8:30 AM
    Moderator