Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows.Forms.Clipboard.ContainsText crashes with ComWrappers #50

Open
jaedan opened this issue Dec 30, 2022 · 0 comments
Open

Windows.Forms.Clipboard.ContainsText crashes with ComWrappers #50

jaedan opened this issue Dec 30, 2022 · 0 comments

Comments

@jaedan
Copy link

jaedan commented Dec 30, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant