|
-
Access Denied error while using EnableNotification in MSMQ
I am trying to create a queue listener for MSMQ.
This is the code which i am using to create a queue
Dim Qinfo As New MSMQQueueInfo
Dim Q As MSMQQueue
Dim msg As New MSMQMessage
Dim msgEvent As MSMQEvent
Sub Listener()
Qinfo.PathName = ".\testqueue"
Qinfo.Label = "Test Queue"
Set msgEvent = New MSMQEvent
Set Q = Qinfo.Open(MSMQ.MQ_SEND_ACCESS, MSMQ.MQ_DENY_NONE)
msg.Label = "Label"
msg.Body = "Help me please"
msg.Send Q
Q.EnableNotification Event:=msgEvent, ReceiveTimeout:=1000
End Sub
Private Sub msgEvent_Arrived(ByVal Queue As Object, _
ByVal Cursor As Long)
On Error GoTo msgArrivedErrorHandler
Set Q = Qinfo.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)
Set msg = Q.Receive(ReceiveTimeout:=0)
Q.EnableNotification Event:=msgEvent, ReceiveTimeout:=10000
Exit Sub
msgArrivedErrorHandler:
MsgBox err.Description + " in Arrived event"
End Sub
But at runtime in Listener sub i am getting error as "Access Denied"
on "Q.EnableNotification Event:=msgEvent, ReceiveTimeout:=1000" line.
Please give me the solution for this error.
Thanks & Regards
Somesh Chandra
Software Elements India Pvt. Ltd.
Suite G-1, Shalimar Building,
216, Marine Drive.
Mumbai - 400 020
Voice: 91 - 22 – 202 6068/202 6114
Web Presence : www.seipl.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks