MessageQueue Constructor (String^, Boolean, Boolean)

 

Initializes a new instance of the MessageQueue class.

Namespace:   System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

public:
MessageQueue(
	String^ path,
	bool sharedModeDenyReceive,
	bool enableCache
)

Parameters

path
Type: System::String^

The location of the queue referenced by this MessageQueue, which can be "." for the local computer.

sharedModeDenyReceive
Type: System::Boolean

true to grant exclusive read access to the first application that accesses the queue; otherwise, false.

enableCache
Type: System::Boolean

true to create and use a connection cache; otherwise, false.

The following code example creates a new MessageQueue with exclusive read access and with connection caching enabled.

// Connect to a queue on the local computer, grant exclusive read
// access to the first application that accesses the queue, and
// enable connection caching.
MessageQueue^ queue = gcnew MessageQueue(".\\exampleQueue", true, true);

queue->Close();

.NET Framework
Available since 2.0
Return to top
Show: