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)
- window.runtime should be available to files other than index.html HOT 3
- when will wails v3 stable version be released? HOT 1
- Is it possible to add a "runtime.Restart()" api
- Template Document 404
- EventsEmit cannot handle file types, Can you add a file type
- How to detect WebView back and forward events?
- Please add Goland support HOT 1
- Error: flag provided but not defined: -nopackage HOT 2
- Wails app crash when Frameless attribute is use in two apps in a row on Linux HOT 1
- Cannot pass a string to createFrom on field with type "any"
- Wails 2.8.1 dev error on browser
- Wails build creating invalid folders based on embed file selections. Then failing. HOT 7
- Removing my templates
- Wails Dev Fails with option -r not recognized HOT 2
- Slice of array causes `wails generate module` to fail
- build arm64 in linux error HOT 2
- atomicgo.dev is not reach anymore, so can´t install wails HOT 2
- Broken link found at docs/guides/obfuscated/ HOT 1
- title wrong in zh : WindowHide not WindowShow
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.