HRESULT
hr = MQ_OK ;
//een bericht in verband met de huidige COM + -object
IObjectContext * pContext = NULL ;
hr = GetObjectContext ( & pContext ) ;
if ( FAILED ( hr ) ) op
{
fprintf ( stderr , " GetObjectContext is mislukt Fout : 0x %
x \\ n . " , hr ) ;
}
//specificeert het type transactie
//MQ_MTS_TRANSACTION , indien de huidige COM + transactionele .
//MQ_SINGLE_MESSAGE
, als de huidige COM + is niet transactionele .
ITransaction
* pTransaction ;
pTransaction
= MQ_MTS_TRANSACTION ;
als
{
( pContext - > IsInTransaction ( ) ! ) pTransaction = MQ_SINGLE_MESSAGE ; .
}
//stuur het bericht
hr = MQSendMessage (
hQueue
,
& MsgProps , < br >
pTransaction
) ;
als ( oNTBROKEN ( hr ) )
{
fprintf ( stderr , " MQOSendMessage gefaald .. Fout : Goedkope 4
Klik op " File " en klik op " Opslaan " om de wijziging toe te passen op uw C-programma .