Giter VIP home page Giter VIP logo

Comments (3)

KayFelicities avatar KayFelicities commented on June 18, 2024 1

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.

stffabi avatar stffabi commented on June 18, 2024

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.

leaanthony avatar leaanthony commented on June 18, 2024

Thanks for letting us know it works!

from wails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.