IShellService::SetOwner method (shdeprecated.h)
Deprecated. Declares an owner reference to the service object.
HRESULT SetOwner( IUnknown *punkOwner );
The address of an interface pointer to the owner object. If NULL, the object should call IUnknown::Release to release the existing reference.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
The client calls CoCreateInstance for IShellService, then calls SetOwner(this) to declare ownership. When the client is dismissed, typically when the window is closed, it calls SetOwner(NULL) to instruct the service object to release the reference to the owner object.