From d78818987dc5ac4d5f7c9215713c0cb2c4fc033c Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Thu, 11 Apr 2024 11:23:48 +0800 Subject: [PATCH 1/3] Update ResourceLoader.cpp --- .../src/ResourceLoader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.cpp b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.cpp index 893d2b3464..f0b7c1ebf9 100644 --- a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.cpp +++ b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.cpp @@ -18,10 +18,13 @@ ResourceLoader::ResourceLoader() SetDefaultContext(); } -ResourceLoader::ResourceLoader(hstring const& fileName) +ResourceLoader::ResourceLoader(hstring const& resourceMap) { + hstring fileName; + winrt::check_hresult(GetDefaultPriFile(fileName)); + winrt::check_hresult(MrmCreateResourceManager(fileName.c_str(), &m_resourceManager)); - winrt::check_hresult(MrmGetChildResourceMap(m_resourceManager, nullptr, L"Resources", &m_currentResourceMap)); + winrt::check_hresult(MrmGetChildResourceMap(m_resourceManager, nullptr, resourceMap.c_str(), &m_currentResourceMap)); SetDefaultContext(); } From 38bbbcf24c158938cee78d20e885a35888d2e51a Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Thu, 11 Apr 2024 11:24:28 +0800 Subject: [PATCH 2/3] Update ResourceLoader.h --- .../src/ResourceLoader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.h b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.h index 29d6159418..b6589a306b 100644 --- a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.h +++ b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/ResourceLoader.h @@ -13,7 +13,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::Resources::implementation struct ResourceLoader : ResourceLoaderT { ResourceLoader(); - ResourceLoader(hstring const& fileName); + ResourceLoader(hstring const& resourceMap); ResourceLoader(hstring const& fileName, hstring const& resourceMap); static hstring GetDefaultResourceFilePath(); From 45561bd81ac83872fdb705b20f1e366d8c261409 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Thu, 11 Apr 2024 11:25:16 +0800 Subject: [PATCH 3/3] Update Microsoft.Windows.ApplicationModel.Resources.idl --- .../src/Microsoft.Windows.ApplicationModel.Resources.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Microsoft.Windows.ApplicationModel.Resources.idl b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Microsoft.Windows.ApplicationModel.Resources.idl index 3c78578a64..74d67e2001 100644 --- a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Microsoft.Windows.ApplicationModel.Resources.idl +++ b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Microsoft.Windows.ApplicationModel.Resources.idl @@ -11,7 +11,7 @@ namespace Microsoft.Windows.ApplicationModel.Resources runtimeclass ResourceLoader { ResourceLoader(); - ResourceLoader(String fileName); + ResourceLoader(String resourceMap); ResourceLoader(String fileName, String resourceMap); static String GetDefaultResourceFilePath();