From 459bb02b8e0ad90693590fa1a5b161963acd091f Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 31 Aug 2015 19:33:42 +0000 Subject: Toaster: loading toast template through string git-svn-id: http://svn.miranda-ng.org/main/trunk@15129 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/toast_notification.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp index 2e9bf89596..5a17833102 100644 --- a/plugins/Toaster/src/toast_notification.cpp +++ b/plugins/Toaster/src/toast_notification.cpp @@ -166,13 +166,33 @@ HRESULT ToastNotification::Setup(_In_ ABI::Windows::Data::Xml::Dom::IXmlDocument HRESULT ToastNotification::CreateXml(_Outptr_ ABI::Windows::Data::Xml::Dom::IXmlDocument** xml) { - ABI::Windows::UI::Notifications::ToastTemplateType templateId = _imagePath == nullptr + Microsoft::WRL::ComPtr xmlDocument; + HRESULT hr = Windows::Foundation::ActivateInstance(StringReferenceWrapper(RuntimeClass_Windows_Data_Xml_Dom_XmlDocument).Get(), &xmlDocument); + if (FAILED(hr)) + return hr; + + if(_imagePath == nullptr) + { + hr = xmlDocument->LoadXml(StringReferenceWrapper(L"").Get()); + } + else + { + hr = xmlDocument->LoadXml(StringReferenceWrapper(L"").Get()); + } + if (FAILED(hr)) + return hr; + + hr = xmlDocument.CopyTo(xml); + if (FAILED(hr)) + return hr; + + /*ABI::Windows::UI::Notifications::ToastTemplateType templateId = _imagePath == nullptr ? ABI::Windows::UI::Notifications::ToastTemplateType_ToastText02 : ABI::Windows::UI::Notifications::ToastTemplateType_ToastImageAndText02; HRESULT hr = notificationManager->GetTemplateContent(templateId, xml); if (FAILED(hr)) - return hr; + return hr;*/ hr = Setup(*xml); if (FAILED(hr)) -- cgit v1.2.3