Although the code is VB I believe the question is OOP
I tried the VB NG but no answer.
I suspect the c# programmer is more apt to be aware of these kinds of
subtleties so I', trying here.
I do the following:
Note that I'm returning and interface because GetDatObject returns an
interface.
Also note that DataObject implements IDataObject
====
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