Share via


AccelerometerCreateMsgCallback (Compact 7)

3/12/2014

This function causes a callback function to be called when new accelerometer messages are available.

Syntax

DWORD WINAPI AccelerometerCreateMsgCallback(
    HSENSOR hAccDevice,
    __in ACCELEROMETER_MSGCALLBACK* pfnCallback,
    __in_opt LPVOID plvCallbackParam
);

Parameters

  • hAccDevice
    [in] Handle of the opened accelerometer device previously returned by the AccelerometerOpen function.
  • 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 code

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

See Also

Reference

Accelerometer COREDLL.DLL Functions
ACCELEROMETER_MSGCALLBACK