To Create a Synchronous Reader and Open a File
[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
Before you can do any work with the synchronous reader, you will need to create a synchronous reader object and load a file for reading. To initialize the synchronous reader and open a file, perform the following steps.
- Create a synchronous reader object by calling the WMCreateSyncReader function. You must specify the desired level of rights management for the new reader object. The available modes are listed in the WMT_RIGHTS enumeration type.
- Specify a file to read by calling IWMSyncReader::Open.
The synchronous reader also supports the use of the IStream COM interface for opening files. You can implement the IStream interface any way you choose. After the desired file is opened in IStream, you can follow the steps listed above, except that you must call IWMSyncReader::OpenStream instead of IWMSyncReader::Open in step 2.
Related topics