From 0d0969cf04186fc92b51dd70789d2740e3634c76 Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Thu, 27 May 2021 14:13:31 -0700 Subject: [PATCH 01/10] ControlFlowGuard(/guard:cf) and EditAndContinue(/ZI) are not compatable, choose /ZI for debug guilds --- .../Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj index 4c475096..87a52fb1 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj @@ -100,7 +100,7 @@ _WINRT_DLL;%(PreprocessorDefinitions) $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) true - Guard + false Console From 8364db5109696e0994d7faf1a6a60d0667f16b12 Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Thu, 27 May 2021 14:14:06 -0700 Subject: [PATCH 02/10] use = default for constructor, avoid a copy --- .../XamlApplication.cpp | 6 +----- .../XamlApplication.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp index 1b078936..78c9a16d 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp @@ -15,7 +15,7 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation { XamlApplication::XamlApplication(winrt::Windows::Foundation::Collections::IVector providers) { - for(auto provider : providers) + for (auto&& provider : providers) { m_providers.Append(provider); } @@ -23,10 +23,6 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation Initialize(); } - XamlApplication::XamlApplication() - { - } - void XamlApplication::Initialize() { const auto out = outer(); diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h index 77097f85..1eac21a4 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h @@ -17,7 +17,7 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation class XamlApplication : public XamlApplicationT { public: - XamlApplication(); + XamlApplication() = default; XamlApplication(winrt::Windows::Foundation::Collections::IVector providers); ~XamlApplication(); From 78fc02bf26fb17b6caae58ff75972bce08d44c00 Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Mon, 30 Aug 2021 12:26:59 -0700 Subject: [PATCH 03/10] remove unneeded copies/cast --- .../XamlApplication.cpp | 7 +++---- .../XamlApplication.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp index 78c9a16d..668d0303 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp @@ -13,7 +13,7 @@ extern "C" { namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation { - XamlApplication::XamlApplication(winrt::Windows::Foundation::Collections::IVector providers) + XamlApplication::XamlApplication(const winrt::Windows::Foundation::Collections::IVector& providers) { for (auto&& provider : providers) { @@ -25,13 +25,12 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation void XamlApplication::Initialize() { - const auto out = outer(); - if (out) + if (const auto out = outer()) { winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider provider(nullptr); winrt::check_hresult(out->QueryInterface( winrt::guid_of(), - reinterpret_cast(winrt::put_abi(provider)))); + winrt::put_abi(provider))); m_providers.Append(provider); } diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h index 1eac21a4..a54c3fbd 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h @@ -18,7 +18,7 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation { public: XamlApplication() = default; - XamlApplication(winrt::Windows::Foundation::Collections::IVector providers); + XamlApplication(const winrt::Windows::Foundation::Collections::IVector& providers); ~XamlApplication(); void Initialize(); From 908350737f5c8264c702861f02aa29589805ab4f Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Fri, 3 Sep 2021 13:38:23 -0700 Subject: [PATCH 04/10] Update to latest C++ WinRT --- ...Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj | 11 ++++++----- .../packages.config | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj index 481387a5..a240c799 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj @@ -1,8 +1,9 @@ - + true + true true {015a0047-772d-4f1a-88c9-45c18f0adfb6} Microsoft.Toolkit.Win32.UI.XamlHost @@ -153,14 +154,14 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + - + \ No newline at end of file diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config b/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config index cee5cecc..34b34a3a 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file From 085a7553250c6c106ce38bf5a79a17137febb1ff Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Wed, 1 Sep 2021 16:10:29 -0700 Subject: [PATCH 05/10] my changes --- .../ReadMe.md | 13 +++++++++- .../XamlApplication.cpp | 24 ++++++------------- .../XamlApplication.h | 4 ++-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/ReadMe.md b/Microsoft.Toolkit.Win32.UI.XamlApplication/ReadMe.md index 853365aa..775f73cd 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/ReadMe.md +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/ReadMe.md @@ -1 +1,12 @@ -Xaml Application for Win32 \ No newline at end of file +# Xaml Application Object for Win32 Apps +Xaml Application object implementation, used in Xaml Island consuming projects (WinForms, WPF, C++) + +## To Build + +Install the .Net 3 SDK from [this location](https://dotnet.microsoft.com/download/visual-studio-sdks). + +## To Run + +- In the XamlHost\Samples node of Solution Explorer +- Set Microsoft.Toolkit.Sample.Forms.App or Microsoft.Toolkit.Sample.Wpf.App as the startup project. +- F5 diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp index 1b078936..9a085f0e 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "XamlApplication.h" @@ -13,9 +13,9 @@ extern "C" { namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation { - XamlApplication::XamlApplication(winrt::Windows::Foundation::Collections::IVector providers) + XamlApplication::XamlApplication(const winrt::Windows::Foundation::Collections::IVector& providers) { - for(auto provider : providers) + for (auto&& provider : providers) { m_providers.Append(provider); } @@ -23,21 +23,11 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation Initialize(); } - XamlApplication::XamlApplication() - { - } - void XamlApplication::Initialize() { - const auto out = outer(); - if (out) - { - winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider provider(nullptr); - winrt::check_hresult(out->QueryInterface( - winrt::guid_of(), - reinterpret_cast(winrt::put_abi(provider)))); - m_providers.Append(provider); - } + const auto& outerWinRt = *reinterpret_cast(outer()); + auto provider = outerWinRt.as(); + m_providers.Append(provider); const auto dispatcherQueue = winrt::Windows::System::DispatcherQueue::GetForCurrentThread(); if (!dispatcherQueue) @@ -157,4 +147,4 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::factory_implementation ::FreeLibrary(module); } } -} \ No newline at end of file +} diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h index 77097f85..a54c3fbd 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h @@ -17,8 +17,8 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation class XamlApplication : public XamlApplicationT { public: - XamlApplication(); - XamlApplication(winrt::Windows::Foundation::Collections::IVector providers); + XamlApplication() = default; + XamlApplication(const winrt::Windows::Foundation::Collections::IVector& providers); ~XamlApplication(); void Initialize(); From 875c40a57aef170deac09b1079d4328595e1a06d Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Fri, 3 Sep 2021 13:40:45 -0700 Subject: [PATCH 06/10] add wil package --- .../Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj | 2 ++ Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config | 1 + 2 files changed, 3 insertions(+) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj index a240c799..8410a490 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj @@ -155,6 +155,7 @@ + @@ -163,5 +164,6 @@ + \ No newline at end of file diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config b/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config index 34b34a3a..215a6533 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file From 1b5fd4cc489a47d9182c4abee8c51e5c4299a4ac Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Fri, 3 Sep 2021 14:32:26 -0700 Subject: [PATCH 07/10] define WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP to access Desktop APIs, disable xml comments (wil generates warnings), cleanup namespace use, unused code --- ...t.Toolkit.Win32.UI.XamlApplication.vcxproj | 6 +-- .../XamlApplication.cpp | 37 ++++++++----------- .../XamlApplication.h | 8 +--- .../pch.h | 16 ++++---- 4 files changed, 29 insertions(+), 38 deletions(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj index 8410a490..6e00250a 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj @@ -100,9 +100,9 @@ Level4 %(AdditionalOptions) /bigobj 28204 - _WINRT_DLL;%(PreprocessorDefinitions) + _WINRT_DLL;%(PreprocessorDefinitions);WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) - true + false Guard @@ -166,4 +166,4 @@ - \ No newline at end of file + diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp index 9a085f0e..b9cb62ad 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp @@ -2,13 +2,10 @@ #include "XamlApplication.h" -namespace xaml = ::winrt::Windows::UI::Xaml; - -extern "C" { - WINBASEAPI HMODULE WINAPI LoadLibraryExW(_In_ LPCWSTR lpLibFileName, _Reserved_ HANDLE hFile, _In_ DWORD dwFlags); - WINBASEAPI HMODULE WINAPI GetModuleHandleW(_In_opt_ LPCWSTR lpModuleName); - WINUSERAPI BOOL WINAPI PeekMessageW(_Out_ LPMSG lpMsg, _In_opt_ HWND hWnd, _In_ UINT wMsgFilterMin, _In_ UINT wMsgFilterMax, _In_ UINT wRemoveMsg); - WINUSERAPI LRESULT WINAPI DispatchMessageW(_In_ CONST MSG* lpMsg); +namespace winrt +{ + using namespace winrt::Windows::UI::Xaml; + using namespace winrt::Windows::UI::Xaml::Hosting; } namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation @@ -25,19 +22,15 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation void XamlApplication::Initialize() { - const auto& outerWinRt = *reinterpret_cast(outer()); - auto provider = outerWinRt.as(); - m_providers.Append(provider); + auto outerWithRef = outer(); + outerWithRef->AddRef(); + winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider metdataProvider{ outerWithRef, winrt::take_ownership_from_abi }; + m_providers.Append(metdataProvider); const auto dispatcherQueue = winrt::Windows::System::DispatcherQueue::GetForCurrentThread(); if (!dispatcherQueue) { - m_executionMode = ExecutionMode::Win32; - m_windowsXamlManager = xaml::Hosting::WindowsXamlManager::InitializeForCurrentThread(); - } - else - { - m_executionMode = ExecutionMode::UWP; + m_windowsXamlManager = winrt::Hosting::WindowsXamlManager::InitializeForCurrentThread(); } } @@ -74,7 +67,7 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation Close(); } - xaml::Markup::IXamlType XamlApplication::GetXamlType(xaml::Interop::TypeName const& type) + winrt::Markup::IXamlType XamlApplication::GetXamlType(winrt::Interop::TypeName const& type) { for (const auto& provider : m_providers) { @@ -88,7 +81,7 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation return nullptr; } - xaml::Markup::IXamlType XamlApplication::GetXamlType(winrt::hstring const& fullName) + winrt::Markup::IXamlType XamlApplication::GetXamlType(winrt::hstring const& fullName) { for (const auto& provider : m_providers) { @@ -102,9 +95,9 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation return nullptr; } - winrt::com_array XamlApplication::GetXmlnsDefinitions() + winrt::com_array XamlApplication::GetXmlnsDefinitions() { - std::list definitions; + std::list definitions; for (const auto& provider : m_providers) { auto defs = provider.GetXmlnsDefinitions(); @@ -114,10 +107,10 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation } } - return winrt::com_array(definitions.begin(), definitions.end()); + return winrt::com_array(definitions.begin(), definitions.end()); } - winrt::Windows::Foundation::Collections::IVector XamlApplication::MetadataProviders() + winrt::Windows::Foundation::Collections::IVector XamlApplication::MetadataProviders() { return m_providers; } diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h index a54c3fbd..6495efc9 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.h @@ -1,10 +1,7 @@ -#pragma once +#pragma once +#include "pch.h" #include "XamlApplication.g.h" -#include -#include -#include -#include namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation { @@ -38,7 +35,6 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation } private: - ExecutionMode m_executionMode = ExecutionMode::Win32; winrt::Windows::UI::Xaml::Hosting::WindowsXamlManager m_windowsXamlManager = nullptr; winrt::Windows::Foundation::Collections::IVector m_providers = winrt::single_threaded_vector(); bool m_bIsClosed = false; diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/pch.h b/Microsoft.Toolkit.Win32.UI.XamlApplication/pch.h index 6bd4c077..d8536841 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/pch.h +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/pch.h @@ -1,12 +1,14 @@ -#pragma once +#pragma once -#include -//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#include -#include - -#include // To enable support for non-WinRT interfaces, unknwn.h must be included before any C++/WinRT headers. +#include #include +#include +#undef GetCurrentTime #include +#include #include + +#include + +#include From 73ac1b42dc104fed248f12815c51e7a0133514e7 Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Thu, 9 Sep 2021 09:17:08 -0700 Subject: [PATCH 08/10] use SDKReference to get access to desktop types --- .../Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj index 6e00250a..0c5bfb81 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/Microsoft.Toolkit.Win32.UI.XamlApplication.vcxproj @@ -3,7 +3,6 @@ true - true true {015a0047-772d-4f1a-88c9-45c18f0adfb6} Microsoft.Toolkit.Win32.UI.XamlHost @@ -152,6 +151,11 @@ + + + Windows Desktop Extensions for the UWP + + From 3387cfbb5ecd42a9c02da7bc020b3165259cfeeb Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Thu, 9 Sep 2021 16:42:51 -0700 Subject: [PATCH 09/10] Update .net runtime to 3.1.412 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index e1f41b88..783ce275 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.409" + "version": "3.1.412" } } From 89c908344ea6d59c373c138e8c6c3a8793731b0e Mon Sep 17 00:00:00 2001 From: Chris Guzak Date: Thu, 9 Sep 2021 16:58:56 -0700 Subject: [PATCH 10/10] QI for metadata provider --- .../XamlApplication.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp index b9cb62ad..69bde3e0 100644 --- a/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp +++ b/Microsoft.Toolkit.Win32.UI.XamlApplication/XamlApplication.cpp @@ -22,10 +22,9 @@ namespace winrt::Microsoft::Toolkit::Win32::UI::XamlHost::implementation void XamlApplication::Initialize() { - auto outerWithRef = outer(); - outerWithRef->AddRef(); - winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider metdataProvider{ outerWithRef, winrt::take_ownership_from_abi }; - m_providers.Append(metdataProvider); + winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider provider{ nullptr }; + winrt::check_hresult(outer()->QueryInterface(winrt::guid_of(), winrt::put_abi(provider))); + m_providers.Append(provider); const auto dispatcherQueue = winrt::Windows::System::DispatcherQueue::GetForCurrentThread(); if (!dispatcherQueue)