I have already created a c library but was hoping to avoid the overhead if possible. Thanks for the reply anyway.
C
cterrinw
@cterrinw
Posts
-
Interface and GetType() - works in C# but not in VB? -
Interface and GetType() - works in C# but not in VB?Hi David, I am having the same problem, I can get the oleUnderlyingDataObject ok but I am unable to get the method getDataFromHGLOBLAL. The last line of code returns nothing... Did you find a resolution to this? Regards Bill Terrington
Public Sub New(ByVal underlyingDataObject As System.Windows.Forms.IDataObject)
'get the underlying dataobject and its ComType IDataObject interface to it
Me.underlyingDataObject = underlyingDataObject
Me.comUnderlyingDataObject = DirectCast(Me.underlyingDataObject, System.Runtime.InteropServices.ComTypes.IDataObject)'get the internal ole dataobject and its GetDataFromHGLOBLAL so it can be called later Dim innerDataField As FieldInfo = CType(Me.underlyingDataObject, Object).\[GetType\].GetField("innerData", BindingFlags.NonPublic Or BindingFlags.Instance) Me.oleUnderlyingDataObject = DirectCast(innerDataField.GetValue(Me.underlyingDataObject), System.Windows.Forms.IDataObject) Me.getDataFromHGLOBLALMethod = CType(Me.oleUnderlyingDataObject, Object).\[GetType\].GetMethod("getDataFromHGLOBLAL", BindingFlags.NonPublic Or BindingFlags.Instance)
End Sub