Explorer DragImage Part III
-
Heath – I’m sure you’re reading this… I’m 95% of the way to a solution to the Explorer dragimage problem. That’s both good and bad news. First off, the problem all along wasn’t my implementation of the COM interfaces; I had that right the whole time. The problem is how c# registers objects as drag targets. It does it automatically, so you have to first revoke and then re-register the control for drag drop to catch the interface’s methods. That being said, I have a test project which, when something from the shell is dragged over the form, will fire the
IDropTarget.DragEnter
event. I have anIDropTargetHelper
object that I’m using to call theDragEnter
method, and voila, the Explorer drag image appears! HOWEVER, I am getting a NullReferenceException when calling the IDropTargetHelper’s DragOver method, and the drag image will not move with the cursor since there's an error. I’ve scoured the net for a reason why this is happening, but no luck there. Debugging doesn’t help since we’re dealing with an unmanaged code… Would you be willing to help in any way? I can post code, email a sample, whatever you might be up for... I’m so close I just need to get over this one last hurdle!! Thanks! -
Heath – I’m sure you’re reading this… I’m 95% of the way to a solution to the Explorer dragimage problem. That’s both good and bad news. First off, the problem all along wasn’t my implementation of the COM interfaces; I had that right the whole time. The problem is how c# registers objects as drag targets. It does it automatically, so you have to first revoke and then re-register the control for drag drop to catch the interface’s methods. That being said, I have a test project which, when something from the shell is dragged over the form, will fire the
IDropTarget.DragEnter
event. I have anIDropTargetHelper
object that I’m using to call theDragEnter
method, and voila, the Explorer drag image appears! HOWEVER, I am getting a NullReferenceException when calling the IDropTargetHelper’s DragOver method, and the drag image will not move with the cursor since there's an error. I’ve scoured the net for a reason why this is happening, but no luck there. Debugging doesn’t help since we’re dealing with an unmanaged code… Would you be willing to help in any way? I can post code, email a sample, whatever you might be up for... I’m so close I just need to get over this one last hurdle!! Thanks!Never mind... I found a work around for the problem