Compartilhar via


MSMQEvent.Arrived (Windows CE 5.0)

Send Feedback

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

void Arrived( IDispatch* Queue,longCursor);

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

OS Versions: Windows CE .NET 4.0 and later.
Header: Mqoai.h.
Link Library: Mqoa.lib.

See Also

MSMQQueue.EnableNotification | MSMQEvent | MSMQQueue

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.