Access Denied error while using EnableNotification in MSMQ

webmasterbeta

New Member
I am trying to create a queue listener for MSMQ.This is the code which i am using to create a queueDim Qinfo As New MSMQQueueInfoDim Q As MSMQQueueDim msg As New MSMQMessageDim msgEvent As MSMQEventSub Listener()Qinfo.PathName = ".\testqueue"Qinfo.Label = "Test Queue"Set msgEvent = New MSMQEventSet Q = Qinfo.Open(MSMQ.MQ_SEND_ACCESS, MSMQ.MQ_DENY_NONE)msg.Label = "Label"msg.Body = "Help me please"msg.Send QQ.EnableNotification Event:=msgEvent, ReceiveTimeout:=1000End SubPrivate Sub msgEvent_Arrived(ByVal Queue As Object, _ByVal Cursor As Long)On Error GoTo msgArrivedErrorHandlerSet Q = Qinfo.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)Set msg = Q.Receive(ReceiveTimeout:=0)Q.EnableNotification Event:=msgEvent, ReceiveTimeout:=10000Exit SubmsgArrivedErrorHandler:MsgBox err.Description + " in Arrived event"End SubBut 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 & RegardsSomesh ChandraSoftware Elements India Pvt. Ltd.Suite G-1, Shalimar Building,216, Marine Drive.Mumbai - 400 020Voice: 91 - 22 ?202 6068/202 6114Web Presence : <!-- w --><a class="postlink" href="http://www.seipl.com">www.seipl.com</a><!-- w -->
 
Back
Top