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

COMException error when dragging over Skype #139

Closed
Antonyo opened this issue Aug 7, 2015 · 4 comments
Closed

COMException error when dragging over Skype #139

Antonyo opened this issue Aug 7, 2015 · 4 comments

Comments

@Antonyo
Copy link

Antonyo commented Aug 7, 2015

Hello, we're developing an application using your component and when a listbox item is dragged onto an Skype conversation a COMException is thrown with the following message: "Error HRESULT E_FAIL has been returned from a call to a COM component." and the application closes. In our case the listbox contains references to file so the data format is FileDrop and the data is the list of selected files referenced in the listbox items.

This is not an issue with your component, it also happen implementing our own drag handler using the System.Windows.DragDrop class so it should be a problem with wpf, what I need is some way to intercept the exception because right now the exception occurs outside the draghandler, I provide below some information about where exactly happen.

I have a commit in my own fork that I can create a pull request out of it: https://github.com/Antonyo/gong-wpf-dragdrop/commit/fba7375e31fa6161aaff1f6e06a96d5160f57231

What steps will reproduce the problem?

  1. Create a listbox with items referencing file path.
  2. Attach a Draghandler to the listbox and set is as DragSource.
  3. On StartDrag create a DataObject with FileDrop as data format and an string[] containing the paths of the selected files as data.
  4. Drag a listbox item onto an skype conversation.

What is the expected output? What do you see instead?

A COMException is thrown with the following message: "Error HRESULT E_FAIL has been returned from a call to a COM component." and the application closes. The skype window correctly attaches the file but the exception shouldn't be thrown.

What version of the product are you using? On what operating system?

I'm using the 0.1.4.3 version and Skype 7.7.64.103 over Windows 8.1.

Please provide any additional information below.

The exception occurs here: https://github.com/punker76/gong-wpf-dragdrop/blob/master/GongSolutions.Wpf.DragDrop/DragDrop.cs#L796

I found an article with a similar scenario but in our case we're actually using the correct FileDrop format:
http://stackoverflow.com/questions/19775784/error-hresult-e-fail-has-been-returned-from-a-call-to-a-com-component-when-try

@SuicSoft
Copy link

SuicSoft commented Dec 2, 2015

@Antonyo I think the best will be a try catch, if it's a WPF problem maybe you should tell Microsoft. I've created a PR which should fix this issue by catching the exception

SuicSoft added a commit to SuicSoft/gong-wpf-dragdrop that referenced this issue Dec 2, 2015
@Antonyo
Copy link
Author

Antonyo commented Dec 2, 2015

Hi @SuicSoft thanks for the info, I actually changed it in my fork, you can see it here: fba7375

I added a handler so I can display an error message in my program rather than swallow the exception.

@SuicSoft
Copy link

SuicSoft commented Dec 2, 2015

Hi @Antonyo .How about creating a PR for that. Then we can chose whether to show a message or just ignore it. Closes #152

@punker76
Copy link
Owner

punker76 commented Dec 2, 2015

@Antonyo Hi, I take your changes and pushes a new alpha version (gong-wpf-dragdrop 1.0.0-ALPHA012). I changed only the name of the method. Thx for your effort! 👏

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

3 participants