#include <hmq.h> MQEVOID MQeQMgrUndo( MQEHSESS hSess, MQECHAR * pQMName, MQECHAR * pQName, MQEINT64 * pConfirmId, MQEINT32 * pCompCode, MQEINT32 * pReason)
#include <hmq.h> static const MQECHAR pHello[] = "Hello world."; MQEHSESS hSess; MQEHFIELDS hMsg; MQEINT32 rc; MQEINT32 compcode; MQEINT32 reason; MQEPMO pmo = MQEPMO_DEFAULT; MQECHAR * qm, *q; qm = "aQM"; q = "QQ"; hSess = MQeInitialize("MyAppsName", &compcode, &reason); hMsg = MQeFieldsAlloc( hSess, MQE_OBJECT_TYPE_MQE_MSGOBJECT, &compcode, &reason); MQeFieldsPut(hSess, hMsg, "hi", MQE_TYPE_ASCII, pHello, sizeof(pHello), &compcode, &reason); /* Put msg with confirmID, the Undo*/ pmo.ConfirmId.hi = 0x2222; pmo.ConfirmId.lo = 0x1111; pmo.Options |= MQE_QMGR_OPTION_CONFIRMID; /* Put 200 messages onto the queue. */ for (i=0; i<200; i++) { MQeQMgrPutMsg( hSess, qm, q, &pmo, hMsg, &compcode, &reason); } /* Undo the 200 putmsg operations. */ MQeQMgrUndo( hSess, qm, q, pmo.ConfirmId, &compcode, &reason); /* Free the message handle */ MQeFieldsFree( hSess, hMsg, &compcode, &reason); MQeTerminate( hSess, &compcode, &reason);