Marton
Marton

Reputation: 831

Outlook add-in drag & drop locks the active explorer

We're developing a VSTO Add-in for Outlook 2010. It's a WPF window, we're using .NET 4. Some strange things are happening when the user drags e-mails from the e-mail list onto our add-in.

While dragging, if the mouse cursor enters any region inside our add-in, the e-mail list will become unresponsive. That means, it won't react anymore when a user tries to click on another e-mail entry. It will just show the previously selected e-mails content. The user can 'reset' the e-mail list if they click on another folder in Outlook's explorer (the tree control on the left side), then everything gets back to normal.

At first I thought this has to do with some unreleased objects in my drop event handlers. However while testing I've discovered some weird things:

Picture 1. Overlap, the problem occurs in this case:

Picture 1. Overlap, the problem occurs in this case.

Picture 2. No overlap, everything works fine: Picture 2. No overlap, everything works fine.

We are using some 3rd party controls (from Infragistics), but it seems to be irrelevant (the same happens when the cursor moves over a normal WPF checkbox in our add-in, for example). The main grid doesn't have the "AllowDrop" attribute explicitly set, or anything related to drag & drop. The same goes with the checkbox I mentioned.

So if anyone has encountered something similar, I would appreciate any hints on what could cause this issue. I will provide more details (XAML or event handlers) if necessary.

Upvotes: 0

Views: 839

Answers (1)

VeV
VeV

Reputation: 1246

The root cause of your issues must be some implementation bug not releasing properly the COM Object. The symptoms seems to appears both in Windows Form and WFP though they are not exactly the same. I suggest you give a try at the following links to get down to the bottom of your problem.

As a heads up the first and simplest thing you should try is to put this in your drag callbacks function (leave & drop I would say). It seems to somehow release the object.

e.Data.GetData("RenPrivateMessages");

Cannot take credit for it... Kudos goes to Matt Quinn (see first link comments). Bravo Matt...!!!

Have a look here for the complete explanation: http://www.add-in-express.com/creating-addins-blog/2012/03/26/outlook-task-pane-drag-drop/

You have an interesting workaround here as well: http://blogs.msdn.com/b/emeamsgdev/archive/2011/08/13/drag-and-drop-in-outlook-2010.aspx

Regards VeV

Upvotes: 1

Related Questions