Skip to content

Latest commit

 

History

History
98 lines (82 loc) · 3.45 KB

nf-comsvcs-iobjectcontext-setabort.md

File metadata and controls

98 lines (82 loc) · 3.45 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:comsvcs.IObjectContext.SetAbort
IObjectContext::SetAbort (comsvcs.h)
Declares that the transaction in which the object is executing must be aborted and that the object should be deactivated when it returns from the currently executing method call.
IObjectContext interface [COM+]
SetAbort method
IObjectContext.SetAbort
IObjectContext::SetAbort
SetAbort
SetAbort method [COM+]
SetAbort method [COM+]
IObjectContext interface
_cos_IObjectContext_SetAbort
comsvcs/IObjectContext::SetAbort
cos.iobjectcontext_setabort
cos\iobjectcontext_setabort.htm
cos
c254305f-1fc5-417e-b93b-d5e2b36e9e39
12/05/2018
IObjectContext interface [COM+],SetAbort method, IObjectContext.SetAbort, IObjectContext::SetAbort, SetAbort, SetAbort method [COM+], SetAbort method [COM+],IObjectContext interface, _cos_IObjectContext_SetAbort, comsvcs/IObjectContext::SetAbort, cos.iobjectcontext_setabort
comsvcs.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Windows
19H1
IObjectContext::SetAbort
comsvcs/IObjectContext::SetAbort
c++
APIRef
kbSyntax
COM
ComSvcs.h
IObjectContext.SetAbort

IObjectContext::SetAbort

-description

Declares that the transaction in which the object is executing must be aborted and that the object should be deactivated when it returns from the currently executing method call.

-returns

This method can return the following values.

Return code Description
S_OK
The method completed successfully.
E_UNEXPECTED
An unexpected error occurred. This can happen if one object passes its IObjectContext pointer to another object and the other object calls SetAbort using this pointer. An IObjectContext pointer is not valid outside the context of the object that originally obtained it.

-remarks

The object is deactivated automatically on return from the method in which it called SetAbort. If the object is the root of an automatic transaction, COM+ aborts the transaction. If the object is transactional but not the root of an automatic transaction, the transaction in which it's participating is doomed to abort.

You can call SetAbort in error handlers to ensure that a transaction aborts when an error occurs. You can also call SetAbort at the beginning of a method to prevent your object from committing prematurely in the event of an unexpected return and then, if all goes well, call SetComplete just before the method returns.

-see-also

IObjectContext