Partager via


MSMQEvent.Arrived (Windows Embedded CE 6.0)

1/6/2010

This event is fired when MSMQQueue.EnableNotification has been called and a message is found at the appropriate location in the queue.

Syntax

void Arrived( 
  IDispatch* Queue, 
  long Cursor
);

Parameters

  • eventObject
    Instance of event (MSMQEvent) object used for the event handler.
  • Queue
    Queue (MSMQQueue) object that represents an open instance of the queue where the message arrived.
  • Cursor
    Indicates the value of the Cursor argument in the call to MSMQQueue.EnableNotification that triggered the event. Its values can be

    • MQMSG_FIRST (default value of EnableNotification)
    • MQMSG_CURRENT
    • MQMSG_NEXT

    Refer to this value when re-enabling notification within your event handler.

Remarks

The Arrived event is fired by an instance of the MSMQEvent object. Every queue that calls MSMQQueue.EnableNotification triggers an instance of the MSMQEvent object when a message arrives at the specific cursor location in the queue. This includes existing messages in the queue when EnableNotification is first called.

MSMQQueue.EnableNotification can be called with two possible Cursor parameter values:

  • MQMSG_FIRST to signal a notification a message is in the queue. This is the default value
  • A combination of MQMSG_CURRENT and MQMSG_NEXT values to traverse the queue

Regardless of the Cursor parameter setting, MSMQQueue.EnableNotification must be called to start notification and explicitly reset notification after each Arrived event is fired.

There is no association between an Arrived event and a specific message. The Arrived event only means that a message arrived at a specific location in the queue.

Although an Arrived event is fired for a message, there is no guarantee that the message that triggered the event will still be there when the event handler tries to read the message.

Queues are dynamic, and another application might have already removed the message that triggered the Arrived event.

Requirements

Header mqoai.h
Library mqoa.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

MSMQEvent
MSMQQueue.EnableNotification
MSMQQueue