MicrosoftEdge / MicrosoftEdge/WebView2Feedback

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

Open
#5,381 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or implementation entry points are named. Start by reproducing Movicon11 with two WebView2 ActiveX controls and examine the CreateDispatcherQueueController call during simultaneous initialization or screen switching; done requires identifying and resolving the RPC_E_WRONG_THREAD failure or documenting the required lifecycle constraints.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.