Platform SDK: Transaction Server

IObjectContext::SetAbort, IObjectContext::SetComplete Methods Example

[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]

#include <mtx.h>


IObjectContext* pObjectContext = NULL;
HRESULT hr;

hr = GetObjectContext(&pObjectContext);
// Do some work here.
// If the work was successful, call SetComplete.
if (SUCCEEDED(hr)) {
    if (pObjectContext)
        pObjectContext->SetComplete();
}
// Otherwise, call SetAbort.
else {
    if (pObjectContext)
        pObjectContext->SetAbort();
}