diff options
Diffstat (limited to 'shared/com_util.h')
-rw-r--r-- | shared/com_util.h | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/shared/com_util.h b/shared/com_util.h index a396fbee..4a8c4f54 100644 --- a/shared/com_util.h +++ b/shared/com_util.h @@ -31,10 +31,10 @@ std::wstring getText(ComPtr<T> comObj, MemFun memFun); class Bstring { public: - Bstring(const std::wstring& str); - ~Bstring(); + Bstring(const std::wstring& str) { str_ = ::SysAllocStringLen(str.data(), str.length()); } //string::data() returns unmodified string potentially containing 0-values + ~Bstring() { if (str_) ::SysFreeString(str_); } - const BSTR get() const; + const BSTR get() const { return str_; } private: Bstring(const Bstring&); //not implemented @@ -127,28 +127,6 @@ std::wstring getText(ComPtr<T> comObj, MemFun memFun) } return text; } - - -inline -Bstring::Bstring(const std::wstring& str) -{ - str_ = ::SysAllocStringLen(str.data(), str.length()); //string::data() returns unmodified string potentially containing 0-values -} - - -inline -Bstring::~Bstring() -{ - if (str_) - ::SysFreeString(str_); -} - - -inline -const BSTR Bstring::get() const -{ - return str_; -} } |