IHolder::Close method (comsvcs.h)
Closes the Holder.
Syntax
HRESULT Close();
Return value
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
This closes a Resource Dispenser's Holder, after which the Resource Dispenser probably released.
Before closing, any remaining inventory is destroyed by calling back to the Resource Dispenser's IDispenserDriver::DestroyResource method.
The following sequence describes how to close down a Resource Dispenser:
- Obtain a reference to the Resource Dispenser (the object that exposes IDispenserDriver).
- Call a method in Resource Dispenser whose implementation calls IHolder::Close.
- IHolder::Close destroys any remaining inventory by calling back to Resource Dispenser's IDispenserDriver::DestroyResource method.
- IHolder::Close calls the Dispenser Manager to remove this Holder from the Holder list. (If no Holders remain, the Dispenser Manager object deletes itself.)
- IHolder::Close releases its reference to Resource Dispenser's IDispenserDriver interface. This is the reason you need a reference in step 1; otherwise, the Resource Dispenser would delete itself prematurely before the subsequent steps can be completed.
- IHolder::Close returns to the Resource Dispenser.
- The Resource Dispenser calls IDispenserDriver::DestroyResource. The Holder now deletes itself.
- The method called in step 2 now returns.
- Release your final reference to the Resource Dispenser, which now deletes itself.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | comsvcs.h |