Implementing a COM+ Resource Dispenser
The following steps outline a general procedure for implementing a COM+ resource dispenser:
Decide on RESTYPID format that categorizes how your resources differ from each other.
Use the Mtxdm.h and Mtxdm.lib header file and library, respectively.
Build a DLL that implements the IDispenserDriver interface and the API you want to expose to applications.
Call IDispenserManager::RegisterDispenser, passing a pointer to your implementation of IDispenserDriver. This causes the dispenser manager to create a holder (pooling manager) for your resource dispenser and then return the pointer to your IHolder interface.
You can now (in response to calls to your API) make calls to AllocResource and FreeResource. AllocResource initially responds by calling back to your CreateResource method, but later AllocResource calls are serviced from the growing pool of resources.