wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.26k stars 1.22k forks source link

V2/Windows10, Failed to unregister class Chrome_WidgetWin_0. Error = 0 #2195

Closed dushixiang closed 1 year ago

dushixiang commented 1 year ago

Description

When using the following code to select and confirm a file on windows 10, ` selection, err := runtime.OpenMultipleFilesDialog(a.ctx, runtime.OpenDialogOptions{ Title: "Select File", Filters: []runtime.FileFilter{ { DisplayName: "Images (.png;.jpg)", Pattern: ".png;.jpg", }, }, }) `

Will cause the program to exit and output

2022/12/12 23:29:15 The parameter is incorrect.
[1212/232915.779:ERROR:window_impl.cc(119)] Failed to unregister class Chrome_WidgetWin_0. Error = 0

To Reproduce

  1. Create a fun at app.go
    selection, err := runtime.OpenMultipleFilesDialog(a.ctx, runtime.OpenDialogOptions{
        Title: "Select File",
        Filters: []runtime.FileFilter{
            {
                DisplayName: "Images (*.png;*.jpg)",
                Pattern:     "*.png;*.jpg",
            },
        },
    })
  2. Call this function from the frontend
  3. Pop up file selection box
  4. Select File and Confirm

Expected behaviour

Files can be selected normally.

Screenshots

No response

Attempted Fixes

https://github.com/wailsapp/wails/issues/866 Not the same

System Details

Wails CLI v2.2.0

Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:             Windows 10 Pro for Workstations
Version:        2009 (Build: 19044)
ID:             21H2
*nsis           N/A             Available

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - nsis : Available at https://nsis.sourceforge.io/Download

If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

No response

dushixiang commented 1 year ago

I found the reason. The frontend would pop up the file selection box in Windows 10, and the backend would pop up at the same time, eventually causing the program to quit.

luoshengheng commented 1 year ago

我也遇到这个问题,请问你的解决方法是?

dushixiang commented 1 year ago

我也遇到这个问题,请问你的解决方法是?

禁用前端页面本身的文件选择框,使用wails自身的功能即可。

daimall commented 5 months ago

我也遇到这个问题,请问你的解决方法是?

禁用前端页面本身的文件选择框,使用wails自身的功能即可。

我没有试用前端的对话框,弹出框,点击取消就报这个错误 2024/05/29 11:16:41 The parameter is incorrect. [0529/111641.543:ERROR:window_impl.cc(121)] Failed to unregister class Chrome_WidgetWin_0. Error = 0

是需要专门进行前端页面的文件选择框吗?如何禁用,Thx

levinit commented 2 months ago

https://github.com/wailsapp/wails/issues/3681