Comments (7)
Is this .NET 5 or .NET 6, I think I have this bug fixed in .NET 6, if not, I would recommend you to custom build WinForms which is very easy IMO.
from winformscominterop.
should be .NET 6, the 'OpenFileDialog' is also throw an exception :
System.InvalidCastException
HResult=0x80004002
Message=Unable to cast object of type 'WinFormsComInterop.IExternalObject' to type 'IFileOpenDialog'.
Source=System.Private.CoreLib
StackTrace:
在 System.Runtime.CompilerServices.CastHelpers.ChkCast_Helper(Void* toTypeHnd, Object obj)
在 System.Windows.Forms.OpenFileDialog.CreateVistaDialog()
在 System.Windows.Forms.FileDialog.TryRunDialogVista(IntPtr hWndOwner, Boolean& returnValue)
在 System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner)
在 System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
在 System.Windows.Forms.CommonDialog.ShowDialog()
在 BYHKTools.frmDevice.<.ctor>b__3_7(Object _, EventArgs _) 在 D:\code\faceconsole2\BYHKTools\frmDevice.cs 中: 第 211 行
在 System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)
from winformscominterop.
Is this .NET 5 or .NET 6, I think I have this bug fixed in .NET 6, if not, I would recommend you to custom build WinForms which is very easy IMO.
Any ideas on how to build custom WinForms ourselves? You mention it twice in some other issues but I fail to see how easy it is without at least a pointer to some page, link or howto explaining how easy it is. Much appreciated!
from winformscominterop.
Any ideas on how to build custom WinForms ourselves?
you literally
- clone https://github.com/dotnet/winforms
- Run build.cmd
- Add produced binaries as reference
Location of outputs are described on build instructions page https://github.com/dotnet/winforms/blob/main/docs/building.md#build-outputs
from winformscominterop.
Any ideas on how to build custom WinForms ourselves?
you literally
- clone https://github.com/dotnet/winforms
- Run build.cmd
- Add produced binaries as reference
Location of outputs are described on build instructions page https://github.com/dotnet/winforms/blob/main/docs/building.md#build-outputs
Hey, thanks for your quick answer! I had seen that repo but I was skeptical that it would be just like you say and that the repo was compatible and/or had the full source code to make a working Windows.Forms implementation. Usually Microsoft code is full of riddles and sometimes it's the equivalent of attempting to build a linux kernel 😂 it's kinda surprising, so I'll give that a try, thank you!
Assuming it works though, this means that it would solve the COM issues when using this lib and/or NativeAOT with Windows Forms, right?
from winformscominterop.
this means that it would solve the COM issues when using this lib
If you take latest main
branch. Apply dotnet/winforms#5319 on top of it, that specific issue would be gone. If you have another issue in another control, for me this is separate issue and please post separately/
Aforementioned PR is about to get finished, so expect to just use main branch. Overall WinForms team positive to AOT of WinForms and I expect that this project would dissolve itself, since WinForms would be ready for AOT by itself.
Just in case you would be interested. If you have bug with Windows Forms it is trivial to contribute. Guys on the project good to work with, even if they strict about quality.
from winformscominterop.
Latest WinForms in .NET 7 will have a fix. It is not possible to have fix in .NET 6 so I will close issue.
from winformscominterop.
Related Issues (20)
- Crashes with net6-windows and WinFormsComInterop >= 0.4 HOT 5
- Support interface ICoreWebView2_3 for Webview2
- Support ManagementObjectSearcher Class
- WinFormsComInterop.SourceGenerator does not work with Type StringBuilder
- do not support PictureBox and ImageList
- how to use from simple winform demo ,i run is throw exception HOT 9
- Why some conputer run AOT exe show error dialog,but others not? HOT 8
- dont working with net8
- Using System.Windows.Forms.Integration.ElementHost.ElementHost in Avalonia crash HOT 6
- Use .ico file for winform HOT 1
- BlazorHybrid demo does not work HOT 11
- Can WinFormsComInterop work with json HOT 1
- Need support for .net8
- .net 8 support
- .NET 8.0. "Failed to launch design tools server process" HOT 2
- Working with WMPLib.WindowsMediaPlayer HOT 2
- Winforms samples dont compile, dozens of errors HOT 1
- Failed to load assembly 'Microsoft.Web.WebView2.WinForms.WebView2
- winform net7 aot ,Close() application execution error HOT 3
- May I ask when. net8 can be supported HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winformscominterop.