ICcSvcHost::GetService (Windows CE 5.0)

Send Feedback

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

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 Values

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

OS Version: Windows CE 5.0 and later.
Header: CcSvcHost.h.
Link Library: none.

See Also

Core Connectivity Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.