Access Denied error while using EnableNotification in MSMQ


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Access Denied error while using EnableNotification in MSMQ

  1. #1
    Somesh Chandra Guest

    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


  2. #2
    Homer J Simpson Guest

    Re: Access Denied error while using EnableNotification in MSMQ


    I have an msmq problem. what group will I post to. XML thats the one.
    DOH!!!
    "Somesh Chandra" <someshc@yahoo.com> wrote:
    >
    >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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center