MSMQEvent
A version of this page is also available for
4/8/2010
This object implements a single event handler that can support multiple queues.
The MSMQEvent object provides an Arrived event that is fired when a message arrives at the queue.
The MSMQEvent object also provides an ArrivedError event that is fired in two cases:
- When an error occurs while the message is being delivered
- When the message is not retrieved before a time-out timer expires (when asynchronously reading messages)
Events
The following table lists the events of the MSMQEvent object.
Event | Description |
---|---|
Fired when a message is found in the queue. |
|
Fired when an error is generated by Message Queuing. |
Each instance of the MSMQEvent object can be associated with any number of queues. This allows receiving applications to have one generic event handler that can treat all common tasks identically, using the different queue handles passed to the event handler for special-case situations.
The formal parameter passed to the MSMQEvent_Arrived event is of type Object (required because event firing is implemented in terms of IDispatch), which means that the event handler uses COM late-binding by default instead of early-binding.
However, early-binding is more efficient, and the applications can assign the formal parameter to a local variable of type MSMQQueue to regain the benefits of early-binding.
The MSMQEvent object is implemented in terms of callbacks, and is limited to 64 callbacks per process.
Internally, Message Queuing uses the WaitForMultipleObjects function, which is limited to 64 objects per process.
Requirements
Header | mqoai.h |
Library | mqoa.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |