diff options
Diffstat (limited to 'c/common.h')
-rw-r--r-- | c/common.h | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -11,7 +11,22 @@ #define WA "A" #endif -std::wstring WsFromSz(const char* sz, int iCp = CP_UTF8); +struct wstring_owner +{ + wstring_owner(); + wstring_owner(wchar_t* wsz); + wstring_owner& operator=(wchar_t* wsz); + wstring_owner(wstring_owner& wso) = delete; + wstring_owner& operator=(wstring_owner& wso) = delete; + wstring_owner(wstring_owner&& wso) noexcept; + wstring_owner& operator=(wstring_owner&& wso) noexcept; + wchar_t *release(); + operator bool() const; + ~wstring_owner(); + wchar_t* p = nullptr; +}; + +wstring_owner WsoFromSz(const char* sz, int iCp = CP_UTF8); int EBMessageBox(const wchar_t* wszText, const wchar_t* wszCaption, unsigned uType); struct Win32Error : public std::exception |