Extend wxMSW contributor guide

List useful wrapper classes for Windows API provided by wxWidgets.

Closes https://github.com/wxWidgets/wxWidgets/pull/2578
This commit is contained in:
PB 2021-11-03 16:57:12 +01:00 committed by Vadim Zeitlin
parent cce8e41b20
commit d7e33a5291

View File

@ -28,8 +28,28 @@ contents and use the utility classes and functions from it instead of
duplicating their functionality (which can often be done only in exception duplicating their functionality (which can often be done only in exception
unsafe way). unsafe way).
2. Utility classes
---------------------------
2. Windows features checks wxWidgets provides a couple of useful (mostly undocumented) classes making
Windows API easier to work with.
Please whenever possible do not use raw pointers for BSTR, COM interfaces
or task memory, use the appropriate RAII wrapper instead (see below).
Grep wxWidgets source code for the class name to see how it is to be used.
*wxBasicString*: for `BSTR`, in `"wx/msw/ole/oleutils.h"`
*wxCOMPtr*: simplistic smart pointer for COM interfaces, in `"wx/msw/private/comptr.h"`
*wxCoTaskMemPtr*: smart pointer for memory allocated/freed with `CoTaskMem{Alloc/Free}()`,
in `"wx/msw/private/cotaskmemptr.h"`
*wxSafeArray*: for `SAFEARRAY`, in `"wx/msw/ole/safearray.h"`
3. Windows features checks
-------------------------- --------------------------
All checks of features not present in all Windows versions must be done both at All checks of features not present in all Windows versions must be done both at