Use application name when app user model ID is not available

This commit is contained in:
Cheng Zhao 2015-11-24 15:11:43 +08:00
parent c060539562
commit 087eeedab8
4 changed files with 24 additions and 13 deletions

View file

@ -8,26 +8,34 @@
ScopedHString::ScopedHString(const wchar_t* source)
: str_(nullptr) {
Set(source);
Reset(source);
}
ScopedHString::ScopedHString(const std::wstring& source)
: str_(nullptr) {
WindowsCreateString(source.c_str(), source.length(), &str_);
Reset(source);
}
ScopedHString::ScopedHString() : str_(nullptr) {
}
ScopedHString::~ScopedHString() {
if (str_)
WindowsDeleteString(str_);
Reset();
}
void ScopedHString::Set(const wchar_t* source) {
void ScopedHString::Reset() {
if (str_) {
WindowsDeleteString(str_);
str_ = nullptr;
}
}
void ScopedHString::Reset(const wchar_t* source) {
Reset();
WindowsCreateString(source, wcslen(source), &str_);
}
void ScopedHString::Reset(const std::wstring& source) {
Reset();
WindowsCreateString(source.c_str(), source.length(), &str_);
}