comparison 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
comparison
equal deleted inserted replaced
2153:9c1a64ebb686 2154:a8b55524b1b2
231 231
232 GetTempPathW(MAX_PATH, tempdir); 232 GetTempPathW(MAX_PATH, tempdir);
233 wcscat(tempdir, AppID); 233 wcscat(tempdir, AppID);
234 wcscat(tempdir, L".WebView2\\"); 234 wcscat(tempdir, L".WebView2\\");
235 CreateDirectoryW(tempdir, NULL); 235 CreateDirectoryW(tempdir, NULL);
236
237 CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
236 238
237 CreateCoreWebView2EnvironmentWithOptions(nullptr, tempdir, nullptr, 239 CreateCoreWebView2EnvironmentWithOptions(nullptr, tempdir, nullptr,
238 Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>( 240 Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(
239 [this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT { 241 [this](HRESULT result, ICoreWebView2Environment* env) -> HRESULT {
240 // Successfully created Edge environment, return TRUE 242 // Successfully created Edge environment, return TRUE