System.Messaging Reference (Document! X Sample)
Receive(MessageQueueTransaction) Method



System.Messaging Namespace > MessageQueue Class > Receive Method : Receive(MessageQueueTransaction) Method
The MessageQueueTransaction object.
Receives the first message available in the transactional queue referenced by the MessageQueue. This call is synchronous, and blocks the current thread of execution until a message is available.
Syntax
'Declaration
 
Public Overloads Function Receive( _
   ByVal transaction As MessageQueueTransaction _
) As Message
'Usage
 
Dim instance As MessageQueue
Dim transaction As MessageQueueTransaction
Dim value As Message
 
value = instance.Receive(transaction)

Parameters

transaction
The MessageQueueTransaction object.

Return Value

A Message that references the first message available in the queue.
Exceptions
ExceptionDescription
An error occurred when accessing a Message Queuing method.-or- The queue is non-transactional.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

MessageQueue Class
MessageQueue Members
Overload List