Fix using deleted function in TempStringRef
Use the constructor directly instead of via a make function.
This commit is contained in:
@@ -66,11 +66,9 @@ public:
|
||||
|
||||
operator HSTRING() const { return m_hstring; };
|
||||
|
||||
static const TempStringRef Make(const wxString &str);
|
||||
|
||||
private:
|
||||
TempStringRef(const wxString& str);
|
||||
|
||||
private:
|
||||
HSTRING m_hstring;
|
||||
HSTRING_HEADER m_header;
|
||||
|
||||
|
@@ -170,7 +170,7 @@ public:
|
||||
|
||||
HRESULT CreateToast(IXmlDocument *xml)
|
||||
{
|
||||
HRESULT hr = ms_toastMgr->CreateToastNotifierWithId(rt::TempStringRef::Make(ms_appId), &m_notifier);
|
||||
HRESULT hr = ms_toastMgr->CreateToastNotifierWithId(rt::TempStringRef(ms_appId), &m_notifier);
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
wxCOMPtr<IToastNotificationFactory> factory;
|
||||
@@ -215,7 +215,7 @@ public:
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
wxCOMPtr<IXmlNodeList> nodeList;
|
||||
hr = (*toastXml)->GetElementsByTagName(rt::TempStringRef::Make("text"), &nodeList);
|
||||
hr = (*toastXml)->GetElementsByTagName(rt::TempStringRef("text"), &nodeList);
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
hr = SetNodeListValueString(0, m_title, nodeList, *toastXml);
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
{
|
||||
wxCOMPtr<IXmlText> inputText;
|
||||
|
||||
HRESULT hr = xml->CreateTextNode(rt::TempStringRef::Make(str), &inputText);
|
||||
HRESULT hr = xml->CreateTextNode(rt::TempStringRef(str), &inputText);
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
wxCOMPtr<IXmlNode> inputTextNode;
|
||||
|
@@ -166,15 +166,14 @@ int RTCore::ms_isAvailable = -1;
|
||||
// wxWinRT::TempStringRef
|
||||
//
|
||||
|
||||
const TempStringRef TempStringRef::Make(const wxString &str)
|
||||
{
|
||||
return TempStringRef(str);
|
||||
}
|
||||
|
||||
TempStringRef::TempStringRef(const wxString &str)
|
||||
: m_hstring(NULL), m_header()
|
||||
{
|
||||
if ( !RTCore::IsAvailable() )
|
||||
{
|
||||
wxLogDebug("Can not create string reference without WinRT");
|
||||
return;
|
||||
}
|
||||
|
||||
// This creates a fast-pass string which must not be deleted using WindowsDeleteString
|
||||
HRESULT hr = RTCore::Get().WindowsCreateStringReference(
|
||||
@@ -221,7 +220,7 @@ bool GetActivationFactory(const wxString& activatableClassId, REFIID iid, void *
|
||||
if ( !RTCore::IsAvailable() )
|
||||
return false;
|
||||
|
||||
HRESULT hr = RTCore::Get().RoGetActivationFactory(TempStringRef::Make(activatableClassId), iid, factory);
|
||||
HRESULT hr = RTCore::Get().RoGetActivationFactory(TempStringRef(activatableClassId), iid, factory);
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
wxLogDebug("RoGetActivationFactory failed %.8x", hr);
|
||||
|
Reference in New Issue
Block a user