# WebView2 in x86 app

**URL:** <https://forum.juce.com/t/webview2-in-x86-app/55269>\
**Category:** General JUCE discussion\
**Created:** [March 6, 2023, 4:06pm UTC](https://forum.juce.com/t/webview2-in-x86-app/55269 "2023-03-06T16:06:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThiagoGuimaraes](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thiagoguimaraes/32/2445_2.png) [@ThiagoGuimaraes](https://forum.juce.com/u/ThiagoGuimaraes)\
**Post date:** [March 6, 2023, 4:06pm UTC](https://forum.juce.com/t/webview2-in-x86-app/55269/1 "2023-03-06T16:06:50Z")

</div>

Hi everyone,

I’m unable to use WebBrowserComponent with **JUCE\_USE\_WIN\_WEBVIEW2** (WebView2Loader.dll) in a **Win32 (x86)** app. When WebView2 constructor calls “webViewHandle = std::move(\*handle)” an **access violation reading location** crashes the app.

> **WebView2**  
> …\juce\_gui\_extra\native\juce\_win32\_WebBrowserComponent.cpp

Using the x64 architecture, I have no problems.

**To reproduce this error** ; create a GUI project with VS 2022 exporter, change the **architecture to Win32** (Debug and Release configuration), enable the juce\_gui\_extra module and enable JUCE\_USE\_WIN\_WEBVIEW2.

**Source code example** ;

MainComponent::MainComponent()  
{

```
File data("C:\\myapp\\userdata\\");
WebBrowserComponent::Options::WinWebView2 winWebView2;
winWebView2 = winWebView2.withUserDataFolder(data);
WebBrowserComponent::Options options;
options = options.withBackend(WebBrowserComponent::Options::Backend::webview2);
options = options.withWinWebView2Options(winWebView2);

webBrowser = std::make_unique<WebBrowserComponent>(options);
addAndMakeVisible(*webBrowser);
webBrowser->goToURL("https://forum.juce.com");
setSize(600, 400);

```

}

**Callstack after call the WebView2 constructor**

| 00aff400() | Unknown |
| --- | --- |
| [Frames below may be incorrect and/or missing] | |
| [External Code] | |
| **\> NewProject.exe!juce::WebView2::WebView2(juce::WebBrowserComponent & o, const juce::WebBrowserComponent::Options & prefs) Line 368** | C++ |
| [External Code] | |
| NewProject.exe!std::\_Optional\_construct\_basejuce::WebView2::WebViewHandle::\_Optional\_construct\_basejuce::WebView2::WebViewHandlejuce::WebView2::WebViewHandle(std::in\_place\_t \_\_param0, juce::WebView2::WebViewHandle && \_\_param1) Line 9 | C++ |
| NewProject.exe!std::\_Non\_trivial\_move\<std::\_Optional\_construct\_basejuce::WebView2::WebViewHandle,juce::WebView2::WebViewHandle\>::\_Non\_trivial\_move\<std::\_Optional\_construct\_basejuce::WebView2::WebViewHandle,juce::WebView2::WebViewHandle\>juce::WebView2::WebViewHandle(std::in\_place\_t \_\_param0, juce::WebView2::WebViewHandle && \_\_param1) Line 9 | C++ |
| NewProject.exe!std::\_Deleted\_copy\_assign\<std::\_Optional\_construct\_basejuce::WebView2::WebViewHandle,juce::WebView2::WebViewHandle\>::\_Deleted\_copy\_assign\<std::\_Optional\_construct\_basejuce::WebView2::WebViewHandle,juce::WebView2::WebViewHandle\>juce::WebView2::WebViewHandle(std::in\_place\_t \_\_param0, juce::WebView2::WebViewHandle && \_\_param1) Line 9 | C++ |
| NewProject.exe!std::\_Non\_trivial\_move\_assign\<std::\_Optional\_construct\_basejuce::WebView2::WebViewHandle,juce::WebView2::WebViewHandle\>::\_Non\_trivial\_move\_assign\<std::\_Optional\_construct\_basejuce::WebView2::WebViewHandle,juce::WebView2::WebViewHandle\>juce::WebView2::WebViewHandle(std::in\_place\_t \_\_param0, juce::WebView2::WebViewHandle && \_\_param1) Line 9 | C++ |

**Despite this** , [using Microsoft’s webview2 sample application](https://github.com/MicrosoftEdge/WebView2Samples/tree/main/GettingStartedGuides/Win32_GettingStarted), I have no problems building with x86 architecture.

---

<div class="post-metadata">

**Author:** ![yosogawa](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@yosogawa](https://forum.juce.com/u/yosogawa)\
**Post date:** [December 11, 2023, 7:35am UTC](https://forum.juce.com/t/webview2-in-x86-app/55269/2 "2023-12-11T07:35:59Z")

</div>

In my app, the x86 Debug Build worked, but only the x86 Release Build went wrong. x64 Debug/Release are both normal. Thank you for information. If it weren’t for this comment, I think I would have wasted another week. JUCE version is old 6.1.6 WebView2 runtime version is 120.0. XXXX.XX (latest of 2023 Dec.)

---

<div class="post-metadata">

**Author:** ![fravezAt](https://avatars.discourse-cdn.com/v4/letter/f/2bfe46/32.png) [@fravezAt](https://forum.juce.com/u/fravezAt)\
**Post date:** [January 13, 2026, 3:53pm UTC](https://forum.juce.com/t/webview2-in-x86-app/55269/3 "2026-01-13T15:53:51Z")

</div>

> [@yosogawa](#):
>
> In my app, the x86 Debug Build worked, but only the x86 Release Build went wrong. x64 Debug/Release are both normal.

Follow up on a similar issue, I can’t build my project using webview2 using JUCE\_USE\_WIN\_WEBVIEW2\_WITH\_STATIC\_LINKING.

The issue only happens when creating an x86 release build of my standalone app. All the other build types (x64 debug/release and x86 debug) are fine.

Here is an output log of the failed build, it seems to be a calling convention mismatch?:

`C:\Users\fravez\Documents\Github\project\JUCE\modules\juce_gui_extra\native\juce_WebBrowserComponent_windows.cpp(920,75): error C2672: ‘juce::WebBrowserComponent::Impl::Platform::WebView2::callMethodWithLpwstrResult’: no matching overloaded function found [C:\Users\fravez\Documents\Github\project\build_x86\iD.vcxproj]`  
`(compiling source file ‘../JUCE/modules/juce_gui_extra/juce_gui_extra.cpp’)`  
`C:\Users\fravez\Documents\Github\project\JUCE\modules\juce_gui_extra\native\juce_WebBrowserComponent_windows.cpp(733,34):could be ‘std::optional`\<`juce::String`\>` juce::WebBrowserComponent::Impl::Platform::WebView2::callMethodWithLpwstrResult(ArgType *,HRESULT (__thiscall ArgType::* )(LPWSTR *))’`  
`C:\Users\fravez\Documents\Github\project\JUCE\modules\juce_gui_extra\native\juce_WebBrowserComponent_windows.cpp(920,75):‘std::optional`\<`juce::String`\>` juce::WebBrowserComponent::Impl::Platform::WebView2::callMethodWithLpwstrResult(ArgType *,HRESULT (__thiscall ArgType::* )(LPWSTR *))’: could not deduce template argument for ‘HRESULT (__thiscall ArgType::* )(LPWSTR *)’ from ‘HRESULT (__stdcall ICoreWebView2WebMessageReceivedEventArgs::* )(LPWSTR *)’`

Webview2 is locally installed with nuget and found by JUCE with the NEEDS\_WEBVIEW2 option.

Using VS Community 2026 and v8.0.12 of JUCE.
