diff win/edge.cpp @ 2154:a8b55524b1b2

Win: Fix CreateCoreWebView2EnvironmentWithOption() failure with no CoInitializeEx().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 18 Sep 2020 00:21:30 +0000
parents 663467f6eee4
children 05dd5189099f
line wrap: on
line diff
--- a/win/edge.cpp	Wed Sep 16 10:33:19 2020 +0000
+++ b/win/edge.cpp	Fri Sep 18 00:21:30 2020 +0000
@@ -234,6 +234,8 @@
 	wcscat(tempdir, L".WebView2\\");
 	CreateDirectoryW(tempdir, NULL);
 
+	CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
+
 	CreateCoreWebView2EnvironmentWithOptions(nullptr, tempdir, nullptr,
 		Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
 			[this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT {