IServiceProvider::QueryServiceIServiceProvider::QueryService*
*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.

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 code—if the function is not implemented, the interface has no reason to exist.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.