title: Using a subclassed DataObject as Clipboard DataObject
body: <p>When I try the following the results are unexpected. Any ideas will be most appreciated!</p>
  
  <pre><code>    Class DataObjectSub
          Inherits DataObject
  
      End Class
  
      Sub Test()
  
          Dim myObject = New DataObjectSub
  
          myObject.SetData("Test")
          Clipboard.SetDataObject(myObject)
  
          Dim myRetrievedObject As IDataObject = Clipboard.GetDataObject
          Console.Write(myRetrievedObject.GetType.ToString)
  
          Dim myRetrievedObject2=TryCast(Clipboard.GetDataObject,DataObjectSub)
  
      End Sub
  </code></pre>
  
  <p>myRetrievedObject2 is Nothing</p>
  
  <p>The output of the Write statement is: "System.Windows.Forms.DataObject".  Shouldn't it be "DataObjectSub"? Am I missing something obvious?</p>
  
  <p>Edited as requested:</p>
  
  <p>In the case of Drag/Drop operations, that DataObject (implementing iDataObject) is again being used one can do this:</p>
  
  <pre><code>Sub TestDragDrop
  
  Dim myObject as iDataObject=new DataObjectSub
  
  someControl.DoDragDrop(myObject, myAllowedEffects)
  
  End Sub
  </code></pre>
  
  <p>Later... in a DragOver event handler:</p>
  
  <pre><code>Sub anotherControl_DragOver(sender as object, e as DragEventArgs)
  
  Dim myRetrievedObject1 as DataObjectSub = TryCast(e.Data, DataObjectSub)
  Dim myRetrievedObject2 as IDataObject = e.Data
  
  
  End Sub
  </code></pre>
  
  <p>works well and both myRetrievedObject1 and myRetrievedObject2 are not Nothing. The types of both retrieved objects are DataObjectSub.</p>
  
  <p>Thanks for any ideas and patience! :)</p>