title: How it is correctly to implement IDTExtensibility2 interface for Office COM Add-In?
body: <p>I am implementing COM Add-In for Outlook. I use IDTExtensibility2. I am not sure whether this is the best way of doing COM Add-Ins but I cannot change that.</p>
  
  <p>This interface defines five methods: OnConnection, OnStartupComplete, OnAddInsUpdate, OnBeginShutdown, OnDisconnection.</p>
  
  <p>I need to perform the following operations: </p>
  
  <ol>
  <li>Load configuration data from file</li>
  <li>Load registry data</li>
  <li>Start new session</li>
  <li>Create *.pst file</li>
  <li>Subscribe to Explorer events</li>
  <li>Connect to Internet Server to get some data</li>
  <li>Create menu items in the main menu</li>
  <li>Create a toolbar </li>
  <li>Add/Remove several things in Outllok (on *.pst files level)</li>
  </ol>
  
  <p>Please advise, what I am supposed to do when? </p>
  
  <ul>
  <li>What I need to perform in OnConnection method?</li>
  <li>What is allowed only when OnStartupComplete invokes?</li>
  <li>What resources I need to free dispose during OnBeginShutdown / OnDisconnection?</li>
  </ul>