AccelerometerCreateCallback (Compact 7)
3/12/2014
This function causes a callback function to be called when new accelerometer samples are available.
Syntax
DWORD WINAPI AccelerometerCreateCallback(
HSENSOR hAccDevice,
__in ACCELEROMETER_CALLBACK* pfnCallback,
__in_opt LPVOID plvCallbackParam
);
Parameters
- hAccDevice
[in] Handle of the opened accelerometer device previously returned by the AccelerometerOpen function.
- pfnCallback
[in] Pointer to an ACCELEROMETER_CALLBACK function that consumes the accelerometer data.
- plvCallbackParam
[in] Pointer to the callback function parameters.
Return Value
The following table shows the possible return values.
Value | Description |
---|---|
ERROR_SUCCESS |
Indicates success. |
ERROR_INVALID_PARAMETER |
Indicates that one or more of the input parameters is invalid. |
ERROR_NOT_ENOUGH_MEMORY |
Indicates that there is not enough memory for this operation. |
Win32 error codes |
Indicates all other errors. |
Remarks
This function creates a message queue that is forwarded to the driver. The accelerometer API then creates a thread which, in turn, calls AccelerometerStart. The thread then waits on the message queue and calls the supplied callback function every time a new sample is available on the message queue.
Requirements
Header |
accapi.h |
sysgen |
SYSGEN_ACCELEROMETER |