Skip to content

[Problem/Bug]: RPC_E_WRONG_THREAD exception with two WebView2 controls #5381

@sgozzi-em

Description

@sgozzi-em

What happened?

Some years ago, using VC++ code samples, we built an ActiveX based on WebView2 to browse web pages.
It’s been built vith VisualStudio 2019, for 32bit applications.
It is used as a graphic component on the screens of our product Movicon11.
Movicon11 is a SCADA application, built vith VisualStudio 2008 (32bit)
The ActiveX browser works good, once added to a screen.
When you have two ActiveX browser on the same screen, at the loading, an exception arises, code 0x8001010E (RPC_E_WRONG_THREAD).
Debugging, I can see an ActiveX that complete its initialization, the second generate the exception while calling CreateDispatcherQueueController.
The same thing happens when the ActiveX are on two different screens and I switch from one screen to the next.
When the ActivX are on different screens, if I spend sone second in a void screen, before to open the second screen, I do not see the exception. It seems like something needs some time to close, before initializing another ActiveX with success.

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

140.0.3485.94

SDK Version

1.00.1072.54

Framework

Win32

Operating System

Windows 10, Windows 11

OS Version

22631.5909

Repro steps

run Movicon11 with two WebView2 controls in a page

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions