IDispenserManager::RegisterDispenser method (comsvcs.h)

Registers the resource dispenser with the dispenser manager.

Syntax

HRESULT RegisterDispenser(
  IDispenserDriver *__MIDL__IDispenserManager0000,
  LPCOLESTR        szDispenserName,
  IHolder          **__MIDL__IDispenserManager0001
);

Parameters

__MIDL__IDispenserManager0000

The IDispenserDriver interface the Resource Dispenser offers to the Dispenser Manager to use later to notify the Resource Dispenser.

szDispenserName

A friendly name of the Resource Dispenser for administrator display.

__MIDL__IDispenserManager0001

The IHolder interface that has been instantiated for the resource dispenser.

Return value

If the method succeeds, the return value is S_OK. Otherwise, it is E_FAIL.

Remarks

The Resource Dispenser notifies the Dispenser Manager that it has started and is prepared to accept notifications on this IDispenserDriver interface. Then the Dispenser Manager creates the Holder for this new Resource Dispenser and returns it to the Resource Dispenser.

This method does not call AddRef on the pDispenserDriver object, but IHolder::Close does perform a Release on pDispenserDriver. This can cause the Resource Dispenser object to be destroyed prematurely. To prevent this premature destruction, the caller of IDispenserManager::RegisterDispenser must explicitly call AddRef on the pDispenserDriver object.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header comsvcs.h

See also

IDispenserManager