次の方法で共有


IWMIndexer::StartIndexing method (wmsdkidl.h)

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

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(
  [in] const WCHAR       *pwszURL,
  [in] IWMStatusCallback *pCallback,
  [in] void              *pvContext
);

Parameters

[in] pwszURL

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

[in] pCallback

Pointer to an IWMStatusCallback interface.

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

Requirement Value
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