From d1e4a8182ed09fc7f6b3be98ff9498ea0e89cac6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 24 Sep 2005 23:08:53 +0000 Subject: [PATCH] make WinStruct<> available in non-GUI code too git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/private.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 72ef5888c9..421a71771e 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -192,6 +192,22 @@ protected: HANDLE m_handle; }; +// a template to make initializing Windows styructs less painful: it zeroes all +// the struct fields and also sets cbSize member to the correct value (and so +// can be only used with structures which have this member...) +template +struct WinStruct : public T +{ + WinStruct() + { + ::ZeroMemory(this, sizeof(T)); + + // explicit qualification is required here for this to be valid C++ + this->cbSize = sizeof(T); + } +}; + + #if wxUSE_GUI #include @@ -342,22 +358,6 @@ inline RECT wxGetClientRect(HWND hwnd) // small helper classes // --------------------------------------------------------------------------- -// a template to make initializing Windows styructs less painful: it zeroes all -// the struct fields and also sets cbSize member to the correct value (and so -// can be only used with structures which have this member...) -template -struct WinStruct : public T -{ - WinStruct() - { - ::ZeroMemory(this, sizeof(T)); - - // explicit qualification is required here for this to be valid C++ - this->cbSize = sizeof(T); - } -}; - - // create an instance of this class and use it as the HDC for screen, will // automatically release the DC going out of scope class ScreenHDC -- 2.45.2