Welcome to CWaitableTimer, a C++ class to support access to the Window
APIs dealing with waitable timers.
Features
- Simple and clean C++ interface.
- The code is Unicode enabled and build configurations are provided.
The enclosed zip file contains the CWaitableTimer
source code and a simple test program which exercises all of the class methods.
Copyright
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
Updates
v1.11 (18 December 2023)
- Updated copyright details.
- Remove usage of __if_exists from module.
v1.10 (24 February 2022)
- Made a number of methods nodiscard.
- Made code independent of ATL by replacing calls to ATLASSUME with
_ASSERTE.
- CWaitableTimer destructor is no longer virtual and class has been marked
as final to prevent inheritance.
v1.09 (11 February 2022)
- Updated copyright details.
- Updated the code to use C++ uniform initialization for all variable
declarations
v1.08 (24 December 2018)
- Fixed a number of compiler warnings when using VS 2017 15.9.3
v1.07 (22 August 2018)
- Fixed a number of compiler warnings when using VS 2017 15.8.1
- Changed the logic which defines wrapper methods for SetWaitableTimerEx
API
v1.06 (20 June 2018)
- Updated copyright details.
- Fixed a number of C++ core guidelines compiler warnings. These changes
mean that the code will now only compile on VC 2017 or later.
v1.05 (4 December 2015)
- Updated copyright details.
- Updated the code to clean compile on VC 2015.
- All the class methods have had SAL annotations added
- The SetOnceOffAbsolute, SetOnceOffRelative, SetPeriodicAbsolute & SetPeriodicRelative
methods has been reworked to expose all the parameters of the underlying SetWaitableTimer
API.
- Removed unnecessary ATLTRACE calls from various methods
- Added support for CreateWaitableTimerEx and SetWaitableTimerEx APIs to class
v1.04 (16 February 2014)
- Updated copyright details
- Made the class into a Header only implementation. The WTimer.cpp module
is now defunct.
- Code now no longer uses GetProcAddress to obtain the waitable timer functions
since waitable timers have been available since Windows 2000.
- Made the code independent of MFC.
- Updated the code to clean compile using /analyze
- Updated the code to clean compile on VC 2010, 2012 & 2013
v1.03 (1 June 2008)
- Code now compiles cleanly using Code Analysis (/analyze)
- The code has now been updated to support VC 2005 or later only.
- Updated the sample app to clean compile on VC 2008
v1.02 (26 June 2006)
- Updated the documentation to use the same style as the web site.
- Updated copyright details.
- Removed various defines in code which were taken from the Platform SDK.
This does mean that the code now requires the Platform SDK if compiled using
VC 6.
- Optimized CWaitableTimer constructor code.
- Combined the functionality of the _WAITABLE_TIMER_DATA class into the main
CWaitableTimer class.
- Code now uses new C++ style casts rather than old style C casts where necessary.
- Reviewed all TRACE statements for correctness
V1.01 (18 February 2004)
- Completion routine can now be passed an LPVOID parameter just like the SDK
equivalent. Thanks to Erenst F. Wepener for suggesting this addition.
- Minor updates to the code to allow the code to compile on VC 5 without the
requirement for the Platform SDK to be installed.
8 November 2002
- Removed some unnecessary comments in the module
- Updated copyright details in the module
V1.0 (8 August 2000)