Comments (3)
Thanks for saving my day! I edited wmi package and changed MTA to STA, and it works. I haven't figured out whether STA is proper for wmi package, but every api I use from wmi package seems work well.
from wails.
Thanks for using Wails and reporting this.
This issue is caused by the fact, that Webview2 (the webview component on Windows) is based on COM, and must be run on Single-Threaded-Appartment Threads.
https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/threading-model
The WebView2 control is based on the Component Object Model (COM) and must run on a Single Threaded Apartments (STA) thread.
The WMI package seems to currently demand Multi-Threaded-Appartment as defined here: https://github.com/drtimf/wmi/blob/main/init.go#L94-L96
I don't know if WMI really needs MTA or can also work with STA. So for the time being the WMI package is not compatible with Wails. You might work around it by using a dedicated OSThread for all WMI operations. But as long as the initialisation of OLE is done in the init()
method, this is not really achievable.
from wails.
Thanks for letting us know it works!
from wails.
Related Issues (20)
- Wails App, built with v2.8.2,【Build error - open .png: file does not exist】 HOT 1
- support windows style toolwindow HOT 1
- Wails App, built with v2.8.2, cannot run on Window 7 HOT 3
- 在创建项目时报错:ERROR Rel: can't make relative to <DIR> 已找到问题,希望修复 HOT 1
- libwebkit2gtk-4.0 not available in Ubuntu 24 HOT 6
- go install err HOT 2
- 如果我在go项目中不指定位置创建文件, 那么这个文件会出现在什么地方 HOT 1
- [BUG] Double file dialog windows when called once, for consecutive rebuilds after initial one via ``wails dev`` HOT 5
- linux/arm64 platform run:wails build ,error HOT 2
- Wails Doctor on Redhat HOT 3
- TypeError: undefined is not an object (evaluating 'window.wails._.Init')
- wails-template-angular-latest link present in 2.7 docs is missing 2.8+ docs
- Windows: libstdc++-6.dll was not found HOT 5
- Spellchecking
- wails2.8 window11 上打开对话框选择确认或则取消都会crash HOT 1
- [V2] TypeError: Cannot destructure property 'order' of 'this.internalProps.sortState' as it is undefined. HOT 2
- wails v2.8.2 Build error - could not determine kind of name for C.free HOT 3
- [v3-Windows] Window resizing not working. HOT 2
- Request to Add Arabic Language Support for Documentation HOT 2
- wails 2.9.0 linux issue HOT 11
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 wails.