ITransactionContextEx::CreateInstance Method Example

#include <Txctx.h>

ITransactionContextEx* pTransactionContext = NULL;
IMyObject* pMyObject = NULL;
HRESULT hr;

// Get TransactionContextEx.
hr = CoCreateInstance(CLSID_ITransactionContextEx, 
    NULL, CLSCTX_INPROC, IID_ITransactionContextEx, 
    (void**) &pTransactionContext);

// Create an instance of MyObject.
hr = pTransactionContext->CreateInstance 
    (CLSID_CMyObject, IID_IMyObject,
    (void**) &pMyObject);