class IResourceManagerSink;
Cette Application Program Interface (API) est implémentée par le gestionnaire de ressources pour le moniteur transactionnel.
#include <transact.h>
#include <txdtc.h>
#include <xolehlp.h>
static IResourceManagerSink *pIResourceManagerSink;
static ITransactionDispenser *pITransactionDispenser;
static IResourceManagerFactory *pIResourceManagerFactory;
static IResourceManager *pIResourceManager;
static GUID Guid;
..
if (pITransactionDispenser->QueryInterface(IID_IResourceManagerFactory, (void **)&pIResourceManagerFactory)!=S_OK)
{
...
}
...
pIResourceManagerFactory->AddRef();
...
if (CoCreateGuid(&Guid)!=S_OK)
{
...
}
...
if (pIResourceManagerFactory->Create(&Guid, "MonResourceManager", pIResourceManagerSink, &pIResourceManager)!=S_OK)
{
...
}
...
pIResourceManager->AddRef();
...
pIResourceManager->Release();
...
pIResourceManagerFactory->Release();
...