
MFCSensor v1.01
A set of freeware MFC wrapper classes for the Windows 7 Sensors API
These set of classes make it a lot easier to use the COM based Sensors API
which was introduced with Windows 7. Eventually I will be extending my
COSMCtrl classes to support Windows 7 sensors in
addition to the authors own GPSCom2 libraries. These
classes are the first step to achieving this.
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
PROPERTYKEY's
The
enclosed
zip file contains the
MFCSensor wrapper classes and a simple VC 2010 dialog based test program to exercise
most of the classes functionality.
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.0 (5 February 2011)
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