MediaQueryEngine_t::AddSink (Windows Embedded CE 6.0)

1/5/2010

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

Header mediaqueryengine.hpp
Library MQELib.lib
Windows Embedded CE Windows CE 5.0 Networked Media Device Feature Pack and later

See Also

Reference

MediaQueryEngine_t