I do the following:
Note that I'm returning and interface because GetDatObject returns an
interface.
Public Shared Function GetContents() As DataObject
Dim ClipboardDataO As IDataObject = Clipboard.GetDataObject()
'assign an IDataObject reference to a DataObject variable
Return ClipboardDataO
End Function
End Class
elsewhere I do
Dim DataO As DataObject = GetContents()
That is I store the reference to the returned interface into an object of
class DataObject (not IDataObject)
It appears to work OK but now I noticed what I did and wonder why it is OK
to assign an IDataObject reference to a DataObject variable
Could you add some understanding the above?
Suppose I use DataO.GetHashCode (there is no IDataObject.GetHashCode) What
happens?
Thanks