Windows Media Format SDK banner art
PreviousNext

Implementing Callback Functions

Some of the objects in the SDK use user-implemented callbacks to communicate with the application. In this case, the application must create an object that implements a particular interface so the SDK can respond to the application. This object is then supplied to the SDK via a method, and the SDK calls methods on the object to indicate various events and information to the application. Since the application implements the object, it can react to the callback methods in any manner.

The reader object uses a callback both to send status messages to the application, and also to send media samples to the application when it is time to render the sample. The callback object must implement IWMReaderCallback, and this object is supplied to the SDK when Open is called on the IWMReader. IWMReaderCallback inherits from IWMStatusCallback, giving the object methods to send samples and status messages through the same object. For more information, see the IWMReaderCallback and IWMStatusCallback sections.

The indexer object uses a callback just to send status messages to the application. In this case, the callback object should implement IWMStatusCallback, which the indexer uses to tell the application when important events have happened.

See Also

PreviousNext


© 1999 Microsoft Corporation. All rights reserved.