MediaQueryEngine_t::AddSink (Windows CE 5.0)

Send Feedback

The AddSink method allows you to add a sink for media library events. you should call AddSink after the library is initialized. You can add one or more sinks.

Syntax

bool AddSink ( 
  const QueryEngineSink_t*pNewSinkObj);

Parameters

  • pNewSinkObj
    The new sink object.

Return Value

This method returns a bool indicating success/failure of the operation. Possible values include the following:

Value Description
TRUE The AddSink operation was successful.
FALSE There was error registering the sink. Check GetLastError() value for more information about the cause for failure.

Remarks

The following is a sample of a user-provided Sink function:

Class UserSink_t:public QueryEngineSink_t
{
     void
     SinkProc(
         QueryEngineEvents_e event
         long   AdditionalInfo
        )
    {
       <Your Code>
    }
}

Guidelines for writing a user sink function:

  • The sink function should return quickly. It should save the information it received and have its thread take action on the event.
  • It should not make any blocking calls.
  • The sink function should not have unhandled exceptions.
  • The sink function must not call MediaQueryEngine_t::Stop or MediaQueryEngine_t::UnInitialize
  • If a sink takes more than 30sec to return or has an unhandled exception, it will stop receiving further Media Query Engine events.

Requirements

OS Versions: Windows CE 5.0 Networked Media Device Feature Pack.
Header: MediaQueryEngine.hpp.
Link Library: MQELib.lib.

See Also

MediaQueryEngine_t

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.