diff --git a/Common/Platform.cpp b/Common/Platform.cpp index 043a45b9..afeb49bf 100644 --- a/Common/Platform.cpp +++ b/Common/Platform.cpp @@ -18,7 +18,6 @@ #include "StdAfx.h" #include "Platform.h" -#include namespace Platform { @@ -37,9 +36,9 @@ LPCWSTR GetPlatformName() return L"Unknown"; } -LPCWSTR GetPlatformFriendlyName() +std::wstring GetPlatformFriendlyName() { - static std::wstring name; + std::wstring name; WCHAR* buffer = new WCHAR[MAX_LINE_LENGTH]; DWORD size = MAX_LINE_LENGTH; @@ -88,7 +87,7 @@ LPCWSTR GetPlatformFriendlyName() delete [] buffer; - return name.c_str(); + return name; } /* diff --git a/Common/Platform.h b/Common/Platform.h index e6b85505..7fd3b218 100644 --- a/Common/Platform.h +++ b/Common/Platform.h @@ -19,6 +19,8 @@ #ifndef RM_COMMON_PLATFORM_H_ #define RM_COMMON_PLATFORM_H_ +#include + #define MAX_LINE_LENGTH 4096 namespace Platform { @@ -31,7 +33,7 @@ typedef BOOL(WINAPI * PGETPRODUCTINFO)(DWORD dwOSMajorVersion, PDWORD pdwReturnedProductType); LPCWSTR GetPlatformName(); -LPCWSTR GetPlatformFriendlyName(); +std::wstring GetPlatformFriendlyName(); bool GetPlatformBit(bool& is64Bit); } // namespace Platform diff --git a/Library/DialogAbout.cpp b/Library/DialogAbout.cpp index a6cd92dd..cda90bab 100644 --- a/Library/DialogAbout.cpp +++ b/Library/DialogAbout.cpp @@ -1239,7 +1239,7 @@ void DialogAbout::TabVersion::Initialize() SetWindowText(item, tmpSz); item = GetControl(Id_WinVerLabel); - SetWindowText(item, Platform::GetPlatformFriendlyName()); + SetWindowText(item, Platform::GetPlatformFriendlyName().c_str()); item = GetControl(Id_PathLabel); std::wstring text = L"Path: " + GetRainmeter().GetPath();