WinFormsComInterop
WinFormsComInterop copied to clipboard
Windows.Forms.Clipboard.ContainsText crashes with ComWrappers
Calling Clipboard.ContainsText() crashes with this call stack:
System.InvalidCastException
HResult=0x80004002
Message=Unable to cast object of type 'WinFormsComInterop.IExternalObject' to type 'System.Runtime.InteropServices.ComTypes.IDataObject'.
Source=System.Private.CoreLib
StackTrace:
at System.StubHelpers.InterfaceMarshaler.ConvertToManaged(IntPtr& ppUnk, IntPtr itfMT, IntPtr classMT, Int32 flags)
at Interop.Ole32.OleGetClipboard(IDataObject& data)
at System.Windows.Forms.Clipboard.GetDataObject(Int32 retryTimes, Int32 retryDelay) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Clipboard.cs:line 146
at System.Windows.Forms.Clipboard.ContainsText() in /_/src/System.Windows.Forms/src/System/Windows/Forms/Clipboard.cs:line 227