次の方法で共有


IWSDiscoveryProvider::SearchById (Compact 2013)

3/26/2014

This method initializes a search for WS-Discovery hosts by device identifier.

Syntax

HRESULT SearchById(
  LPCWSTR pszId,
  LPCWSTR pszTag
);

Parameters

  • pszId
    [in] Device identifier of the desired discovery provider.
  • pszTag
    [in, optional] Optional identifier tag for this search. May be NULL.

Return Value

The following table shows the possible error code return values.

Error code

Description

S_OK

This method completed successfully.

E_INVALIDARG

pszId is NULL, the length in characters of pszId exceeds WSD_MAX_TEXT_LENGTH (8192), or the length in characters of pszTag exceeds WSD_MAX_TEXT_LENGTH (8192).

E_ABORT

A callback interface has not been attached. IWSDiscoveryProvider::Attach must be called before calling this method.

E_OUTOFMEMORY

Not enough memory exists to perform the operation.

Remarks

SearchById initiates a WS-Discovery Resolve in an attempt to locate a previously known specific device. pszId is used as the endpoint address in the Resolve. This call may result in one or more IWSDiscoveryProviderNotify::Add callbacks. If any Add callbacks are issued before the search completes, a IWSDiscoveryProviderNotify::SearchComplete callback will be issued; otherwise, a IWSDiscoveryProviderNotify::SearchFailed callback will be issued.

pszTag is an optional user provided string which will be fed back in either callback, allowing the caller to associate the callback with the original query.

For information about troubleshooting applications calling this method, see Troubleshooting WSDAPI Applications.

Requirements

Header

wsdapi.h

Library

wsdapi.lib

See Also

Reference

IWSDiscoveryProvider
Web Services on Devices Interfaces