The MQMarkMessageRejected function marks a message in a queue as rejected. It should be called only within the scope of a transaction.
HRESULT APIENTRY MQMarkMessageRejected ( QUEUEHANDLE hQueue, ULONGLONG ullLookupId);
[in] The handle of the queue that contains the message to be rejected.
[in] The identity of the message that needs to be rejected.
The MQMarkMessageRejected function returns an HRESULT.
MSMQ is unable to enlist in the specified transaction.
The MQMarkMessageRejected function is invoked as a part of a transaction, but the source or the target queue is not a transactional queue; or the MQMarkMessageRejected function is not invoked within the scope of a transaction.
MSMQ is unable to connect to the Microsoft Distributed Transaction Coordinator (MS DTC).
Either the source or target queue handle was obtained in a previous session of the MSMQ Queue Manager service.
Insufficient resources to complete the operation.
MSMQ service is not available/running.
MSMQ message was not found.
When a message marked as rejected is received, a negative acknowledgement (Nack) with the message class MQMSG_CLASS_NACK_RECEIVE_REJECTED is generated (if a Nack is requested) when the transaction is committed.
|The MQMarkMessageRejected function should be called only within the scope of a transaction; otherwise, the call will fail.|
Windows NT/2000/XP/Vista: Requires Windows Vista or later.
Windows 95/98/Me: Not supported.
Header: Declared in Mq.h.
Library: Use Mqrt.lib.