Contents Index Topic Contents | ||
Previous Topic: The IServiceProvider Interface Next Topic: The IObjectWithSite Interface |
IServiceProvider::QueryService
HRESULT QueryService([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] void **ppv);QueryService is the factory method for any services exposed through an implementation of IServiceProvider. It creates or accesses the implementation the service identified with guidService, returning in *ppv the address of the interface specified by riid.
- Returns:
S_OK The service was successfully created or retrieved. The caller is responsible for calling ((IUnknown *)*ppv)->Release();. E_OUTOFMEMORY There is insufficient memory to create the service. E_UNEXPECTED An unknown error occurred. E_NOINTERFACE The service exists, but the interface requested does not exist on that service. SVC_E_UNKNOWNSERVICE The service identified with guidService is not recognized.
- guidService
- [in] The unique identifier of the service (a SID)
- riid
- [in] The unique identifier of the interface the caller wishes to receive for the service.
- Ppv
- [out] The address of the caller-allocated variable to receive the interface pointer of the service on successful return from this function. The caller becomes responsible for calling Release through this interface pointer when the service is no longer needed.
Because there is only one member function in this interface, E_NOTIMPL is not a valid return codeif the function is not implemented, the interface has no reason to exist.
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.