次の方法で共有


AccelerometerCreateCallback (Compact 2013)

3/26/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.
  • 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

See Also

Reference

Accelerometer COREDLL.DLL Functions
ACCELEROMETER_CALLBACK