title: Error when programmatically adding a DeskBand
body: <p>I'm trying to add a DeskBand object to the system tray programmatically using this code:</p>
  
  <pre><code>[ComImport, Guid("6D67E846-5B9C-4db8-9CBC-DDE12F4254F1"),
  InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface ITrayDeskband
  {
      [PreserveSig]
      int ShowDeskBand([In, MarshalAs(UnmanagedType.Struct)] ref Guid clsid);
      [PreserveSig]
      int HideDeskBand([In, MarshalAs(UnmanagedType.Struct)] ref Guid clsid);
      [PreserveSig]
      int IsDeskBandShown([In, MarshalAs(UnmanagedType.Struct)] ref Guid clsid);
      [PreserveSig]
      int DeskBandRegistrationChanged();
  } 
  
  private void ShowDeskBand()
  {
      ITrayDeskband obj = null;
      Type trayDeskbandType = System.Type.GetTypeFromCLSID(new Guid("E6442437-6C68-4f52-94DD-2CFED267EFB9"));
      try
      {
          Guid deskbandGuid = new Guid("FE0829F8-EDFA-46B6-87E0-636C8D953E33"); // My Deskband | TestToolbar
  
          obj = (ITrayDeskband)Activator.CreateInstance(trayDeskbandType);
          obj.DeskBandRegistrationChanged();
  
          int hr = obj.ShowDeskBand(ref deskbandGuid);
  
          if (hr != 0)
          {
              throw new Exception("Error while trying to show deskband: " + hr);
          }
  
          obj.DeskBandRegistrationChanged();
      }
      catch (Exception e)
      {
          MessageBox.Show(e.Message);
      }
      finally
      {
          if (obj != null &amp;&amp; Marshal.IsComObject(obj))
              Marshal.ReleaseComObject(obj);
      }
  }
  </code></pre>
  
  <p>Source: <a href="http://www.pinvoke.net/default.aspx/Interfaces/ITrayDeskband.html" rel="nofollow">http://www.pinvoke.net/default.aspx/Interfaces/ITrayDeskband.html</a></p>
  
  <p>My DeskBand object is created from the "BandObjectsLib" from this sample: <a href="http://www.codeproject.com/Articles/14141/Band-Objects-NET-2-0-Redux" rel="nofollow">http://www.codeproject.com/Articles/14141/Band-Objects-NET-2-0-Redux</a></p>
  
  <p>It looks like this:</p>
  
  <pre><code>[Guid("FE0829F8-EDFA-46B6-87E0-636C8D953E33")]
  [BandObject("TestToolbar", BandObjectStyle.Horizontal | BandObjectStyle.TaskbarToolBar, HelpText = "Testing this toolbar")]
  public class TestToolbar : BandObject
  {
      public TestToolbar()
      {
          ProgressBar pb = new ProgressBar();
          pb.Maximum = 100;
          pb.Minimum = 0;
          pb.Value = 50;
  
          this.Controls.AddRange(new System.Windows.Forms.Control[] { pb });
      }
  }
  </code></pre>
  
  <p>However, when trying to add the DeskBand object all I get is my exception telling me the error code:
  -2147467259
  This error code translates to a 0x80004005 and according to MSDN that is an E_FAIL: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137.aspx</a></p>
  
  <p>I'm basicly stuck here since this is honestly not my area of expertise. I was hoping that there was someone who might be more experienced and could help me out? Thanks in advance!</p>