WinFormsComInterop icon indicating copy to clipboard operation
WinFormsComInterop copied to clipboard

DragDrop stop working

Open Bxaa opened this issue 3 years ago • 6 comments

DragDrop\DragEnter stop working after add ComWrappers.RegisterForMarshalling(WinFormsComInterop.WinFormsComWrappers.Instance) (Framework.Net 5.0-6.0\AOT)

Notice: Yes, It fix com wrapper error in AOT, but drag and drop events on form, controls stop work (except mouse click, etc)

Maybe any tips?

Thx

Bxaa avatar Jun 22 '22 18:06 Bxaa

Can you try net7.0?

kant2002 avatar Jun 22 '22 18:06 kant2002

There a lot of work done to reduce need for this library in WinForms 7.0 so maybe that would solve your issue

kant2002 avatar Jun 22 '22 18:06 kant2002

net7.0 - nope

I already solved it Implemented drag and drop via IMessageFilter.PreFilterMessage+ pinvoke DragAcceptFile, DragQueryFile, DragFinish (shell32.dll) Now it work with any controls after AOT compiler (also with controls that not support drag drop)

(*) If someone need this i can upload this implementation

Thx, for answer

Bxaa avatar Jun 22 '22 19:06 Bxaa

I suspect that you should just add required interface to here for example https://github.com/kant2002/WinFormsComInterop/blob/b1634b22bbe99309ef6ee93703fc5ad930bbb1e6/WinFormsComInterop/IExternalObject.cs#L20 or maybe even create separate class

kant2002 avatar Jun 23 '22 03:06 kant2002

Thx, i'll ty it

Bxaa avatar Jun 23 '22 23:06 Bxaa

Can you upload the implementation? I'm doing personal project and would like to use it.

GabTeix avatar Aug 10 '22 16:08 GabTeix