WinFormsComInterop icon indicating copy to clipboard operation
WinFormsComInterop copied to clipboard

Using System.Windows.Forms.Integration.ElementHost.ElementHost in Avalonia crash

Open chenrensong opened this issue 2 years ago • 6 comments

Using System.Windows.Forms.Integration.ElementHost.ElementHost in Avalonia

在 WinFormsComInterop.WinFormsComWrappers.ComputeVtables(Object obj, CreateComInterfaceFlags flags, Int32& count) 在 System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags) 在 MS.Win32.UnsafeNativeMethods.RegisterDragDrop(HandleRef hwnd, IOleDropTarget target) 在 System.Windows.DragDrop.RegisterDropTarget(IntPtr windowHandle) 在 System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters) 在 System.Windows.Forms.Integration.ElementHost.<OnHandleCreated>b__54_0() 在 System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) 在 System.Windows.Threading.Dispatcher.Invoke(Action callback) 在 System.Windows.Forms.Integration.ElementHost.OnHandleCreated(EventArgs e) 在 System.Windows.Forms.Control.WmCreate(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

chenrensong avatar Aug 15 '23 03:08 chenrensong

Are you have small sample for the integration? Really small with only one control

kant2002 avatar Aug 15 '23 03:08 kant2002

https://github.com/chenrensong/Avalonia_AOT_WPF

chenrensong avatar Aug 15 '23 05:08 chenrensong

I want to test whether Avalonia AOT and WPF can coexist

chenrensong avatar Aug 15 '23 05:08 chenrensong

WPF currently not supported I would say. So even if I manage to made a progress I expect thing fails down the road. Anyway I would try to make thing working

kant2002 avatar Aug 15 '23 06:08 kant2002

The above error occurred in a debug environment without aot

chenrensong avatar Aug 15 '23 14:08 chenrensong

I did try with custom build of WinFormsComInterop which enables WPF support, but it still requires to have custom WPF fork.

kant2002 avatar Sep 14 '23 03:09 kant2002