class IResourceManager;
Cette Application Program Interface (API) est utilisée par le moniteur transactionnel pour piloter le gestionnaire de ressources.
#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();
...