MFCSensor v1.08
Welcome to MFCSensor, A set of freeware C++ wrapper classes for the Windows
Sensors API.
Features
- Provides a higher level wrapping for the ISensorManager, ISensorManagerEvents,
ISensor, ISensorEvents and ISensorDataReport COM interfaces. These interfaces
are wrapped using ATL's CComPtr class
- Provides prebuilt events classes both for the manager and sensor meaning
you do not need to write your own IUnknown implementation. The classes provided
mean you can implement just the callback methods you require. To hook up eventing
all you need to call is the appropriate SetEventSink method in the appropriate
wrapper class
- Provides a high level wrapping of sensor data types meaning that you can
call a simple function which returns say the current latitude position. Client
code does not need to worry about those messy PROPVARIANT unions or PROPERYKEY's
Usage
- To use MFCSensor in your project simply add MFCSensor.h from the test application
in your application and #include "MFCSensor.h" in whichever files you want to
use the class in. All the code for the classes is implemented in the header
file and templates meaning that you do not need to add any cpp modules to your
project.
- The classes are only supported on VC 2017 or later.
- Included in the download is a VC 2017 dialog based application which demonstrates
most of the main features of the wrapper classes.
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.
History
v1.08 (29 April 2022)
- Updated copyright details.
- Updated the code to use C++ uniform initialization for all variable
declarations.
v1.07 (22 March 2020)
- Updated copyright details.
- Fixed more Clang-Tidy static code analysis warnings in the code.
v1.06 (4 October 2019)
- Fixed a number of compiler warnings when the code is compiled with VS
2019 Preview
- Updated copyright details.
v1.05 (21 October 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.
- Removed all code which supported CMFCSENSOR_MFC_EXTENSIONS code path
v1.04 (19 November 2017)
- Updated copyright details.
- Updated the code to compile cleanly when _ATL_NO_AUTOMATIC_NAMESPACE is
defined.
- Replaced NULL throughout the codebase with nullptr.
v1.03 (13 January 2016)
- Updated copyright details.
- The preprocessor define to enable MFC integration is now
CMFCSENSOR_MFC_EXTENSIONS instead of CBITSWRAPPERS_MFC_EXTENSIONS which was
a copy and paste bug.
- Verified the code compiles cleanly in VC 2015
- Added SAL annotations to all the code
- CSensor::GetFriendlyName now uses ATL::CComBSTR internally
v1.02 (1 December 2013)
- Updated copyright details.
- Updated the code to clean compile in VC 2012/VC 2013
- Reworked the classes to optionally compile without MFC. By default the classes
now use STL for strings and arrays but if you define CBITSWRAPPERS_MFC_EXTENSIONS,
the classes will revert back to using the MFC CString and CArray classes.
- The classes are now in a "SensorAPI" namespace and the MFC prefix for all the
classes have been removed.
v1.01 (7 February 2011)
- CMFCLocationSensorDataReport is now derived from a new "CMFCSensorDataReport"
class.
- Provided a number of new SensorDataReport classes including CMFCElectricalSensorDataReport,
CMFCEnvironmentalSensorDataReport, CMFCLightSensorDataReport, CMFCMechanicalSensorDataReport,
CMFCMotionSensorDataReport, CMFCOrientationSensorDataReport & CMFCScannerSensorDataReport
v1.0 (5 February 2011)
Contacting the Author
PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
29 April
2022