To Disable Automatic Indexing - Win32 apps (2024)

[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.]

You may not always want an index to be generated by default when writing an ASF file. You can disable automatic indexing by using the IWMWriterFileSink3::SetAutoIndexing method.

The following example code demonstrates how to disable automatic indexing by the writer.

IWMWriterFileSink* pBaseFileSink = NULL;IWMWriterFileSink3* pMySink = NULL;BOOL fAutoIndex;HRESULT hr = S_OK;// Initialize COM.hr = CoInitialize(NULL);// Create a writer file sink.hr = WMCreateWriterFileSink(&pBaseFileSink);// Retrieve an IWMWriterFileSink3 interface pointer for the new sink.hr = pBaseFileSink->QueryInterface(IID_IWMWriterFileSink3, (void**)&pMySink);// Release the base file sink.pBaseFileSink->Release();pBaseFileSink = NULL;// Check the state of automatic indexing.hr = pMySink->GetAutoIndexing(&fAutoIndex);// If auto indexing is enabled, turn it off.if(fAutoIndex) pMySink->SetAutoIndexing(FALSE);// You can now write to this sink and the file will not have an index.// Release the remaining interface.pMySink->Release();pMySink = NULL;

Related topics

IWMWriterFileSink3::GetAutoIndexing

WMCreateWriterFileSink

Working with Indexes

Feedback

Was this page helpful?

Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.

Submit and view feedback for

To Disable Automatic Indexing - Win32 apps (2024)

References

Top Articles
Latest Posts
Article information

Author: Corie Satterfield

Last Updated:

Views: 6149

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Corie Satterfield

Birthday: 1992-08-19

Address: 850 Benjamin Bridge, Dickinsonchester, CO 68572-0542

Phone: +26813599986666

Job: Sales Manager

Hobby: Table tennis, Soapmaking, Flower arranging, amateur radio, Rock climbing, scrapbook, Horseback riding

Introduction: My name is Corie Satterfield, I am a fancy, perfect, spotless, quaint, fantastic, funny, lucky person who loves writing and wants to share my knowledge and understanding with you.