Partager via


ICcSvcHost::GetService (Windows Embedded CE 6.0)

1/5/2010

This method creates a service for a device in a given service category.

Syntax

HRESULT GetService(
  LPCOLESTR pwszDeviceId,
  LPCOLESTR pwszServiceCategoryId,
  ICcService** piService
);

Parameters

  • pwszDeviceId
    [in] Identifier for the active logical connection.

    pwszDeviceId must be compatible with the Datastore because ICcSvcHost uses this identifier to call the datastore engine to get the ICcDevice object.

  • pwszServiceCategoryId
    [in] Identifier for the service category.

    pwszServiceCategoryId must be compatible with the Datastore because ICcSvcHost uses this identifier to call the datastore engine to get the ICcServiceCategory object.

  • piService
    [out, retval] Pointer to the ICcService interface object.

    On failure, this is initialized to NULL.

    On success, this pointer points to a valid service object.

Return Value

The following table shows return values for this method.

Value Description

S_OK

Indicates success.

E_OUTOFMEMORY

Indicates an out of memory condition.

E_INVALIDARG

Indicates one or both of the input arguments are invalid.

E_FAIL

Indicates any other failure.

Remarks

If the service is already created and has been cached, this method increments the reference count for the service and returns the cached interface pointer.

Callers are responsible for releasing the service with the piService pointer if they no longer need the service.

The service is hosted within the process of the Service Host, which could be an in-proc or out-of-proc com server.

Requirements

Header ccsvchost.h
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

ICcSvcHost
Core Connectivity Interfaces