IWMIndexer::StartIndexing method

The StartIndexing method initiates indexing. If you configure the indexer using the IWMIndexer2::Configure method, StartIndexing creates an index based upon your configuration. When you use StartIndexing without first calling Configure, the indexer creates a default temporal index.

Syntax

HRESULT StartIndexing(
  const WCHAR       *pwszURL,
  IWMStatusCallback *pCallback,
  void              *pvContext
);

Parameters

pwszURL

Pointer to a wide-character null-terminated string containing the URL or file name.

pCallback

Pointer to an IWMStatusCallback interface.

pvContext

Generic pointer, for use by the application.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_INVALIDARG
The parameter pwszURL or pCallback is NULL.
NS_E_BUSY
The method cannot start indexing in the current state.

Remarks

StartIndexing is an asynchronous call; it returns almost immediately and the application must wait for appropriate OnStatus calls to be sent to the callback function.

If you call StartIndexing for a file that is already indexed, the old index is discarded.

When the indexer successfully indexes a file, it will set some of the reserved attribute values as described in the following table.

Index type Attributes set
WMT_IT_PRESENTATION_TIME g_wszWMSeekable

g_wszWMStridable, if a video stream is present.

WMT_IT_FRAME_NUMBERS g_wszWMNumberOfFrames

g_wszWMSeekable

g_wszWMStridable

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 7 SDK, or later versions of the SDK
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wmsdkidl.h (include Wmsdk.h)
Library Wmvcore.lib; WMStubDRM.lib (if you use DRM)

See also

IWMIndexer Interface

IWMStatusCallback::OnStatus