Freigeben über


ISpNotifyTranslator::InitCallback (Windows CE 5.0)

Send Feedback

This method sets up an ISpNotifyTranslator object to send notifications using a standard C-style callback function.

HRESULT InitCallback(  SPNOTIFYCALLBACK* pfnCallback,  WPARAM wParam,   LPARAM lParam);

Parameters

  • pfnCallback
    [in] Pointer to the notification callback function to use.
  • wParam
    [in] Constant WPARAM value to pass to notification callback function when it is called.
  • lParam
    [in] Constant LPARAM value to pass to the notification callback function when it is called.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
SPERR_ALREADY_INITIALIZED SpTranslator object is already initialized.
E_INVALIDARG pfnCallback is invalid or bad.
FAILED(hr) Appropriate error message.

Remarks

The translator implementation uses a hidden window to call back the client on the same thread that was used to initialize the event source. Notification callbacks are the result of processing a window message. When this notification mechanism is used:

  1. The SPNOTIFYCALLBACK method will always be called on the thread that initialized the event source or notify translator object.

  2. The thread must have a window message pump.

  3. The SPNOTIFYCALLBACK function is declared as follows:

    typedef void __stdcall SPNOTIFYCALLBACK(WPARAM wParam, LPARAM lParam);
    

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.

See Also

ISpNotifyTranslator | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.