MSMQ - Send Message Issue from device to PC

Discussion in 'Microsoft Dot NET Compact Framework' started by shikha meena, Feb 23, 2007.

  1. shikha meena

    shikha meena Guest

    Hi,

    I have written the following code to send message using MSMQ from the
    device to PC.

    Private Sub SendMessageToQueue(ByVal Path As String)
    ' Create a new order and set values.
    myQ = New MessageQueue(Path)
    Dim sendOrder As New MSG
    ID += 1
    Label4.Text = ID
    sendOrder.orderID = Label4.Text

    Label5.Text = DateTime.Now
    sendOrder.orderTime = Label5.Text

    sendOrder.orderBody = TextBox1.Text

    Try
    myQ.Send(sendOrder)
    myQ.Close()
    MsgBox("Message Sent")
    Catch ex As Exception
    MsgBox("SendMessage: " & ex.Message)
    End Try
    End Sub


    On the line "myQ.Send(sendOrder)" following exception is thrown
    "The queue does not exist
    or you do not have sufficient permissions to perform the operation"

    at MQCacheableInfo.get_WriteHandle()
    at System.Messaging.MessageQueue.StaleSafeSendMessage()
    at System.Messaging.MessageQueue.SendInternal()
    at System.Messaging.MessageQueue.Send()
    at MSMQcf.Form1.SendMessageToQueue()
    at MSMQcf.Form1.Button3_Click()


    Any suggestion to resolve this problem will be a great help.

    Thanks
    Shikha
     
    shikha meena, Feb 23, 2007
    #1
    1. Advertisements

  2. shikha meena

    joker Guest

    Have you installed (the cab), then registered and started MSMQ on the
    device?

    Also, you'll need to create the queue.

    MessageQueue.Create(QUEUE_NAME); //I'm not sure of the VB equivalent.

    If MSMQ is installed, check the log file, normally in \temp\msmq, on
    the device for any errors occurring there.

    Good luck and let us know what the issue was.
     
    joker, Feb 23, 2007
    #2
    1. Advertisements

  3. shikha meena

    shikha meena Guest

    On Feb 23, 12:12 pm, "joker" <> wrote:
    > Have you installed (the cab), then registered and started MSMQ on the
    > device?
    >
    > Also, you'll need to create the queue.
    >
    > MessageQueue.Create(QUEUE_NAME); //I'm not sure of the VB equivalent.
    >
    > If MSMQ is installed, check the log file, normally in \temp\msmq, on
    > the device for any errors occurring there.
    >
    > Good luck and let us know what the issue was.


    Hi ,
    I have installed (the cab), then registered and started MSMQ on the
    device.

    I tried creating a queue ..but in case of remote messaging i guess a
    queue cannot be created.. therefore i am getting a error when i try
    creating a queue

    Can u suggest anything ...

    Thanks for the help...

    Shikha
     
    shikha meena, Feb 23, 2007
    #3
  4. shikha meena

    joker Guest

    Any hints in the log file? Also, the queue must be created on the
    Desktop machine, although I don't believe this would prevent you from
    sending the message, just prevent the message from being delivered.

    What is the device you are sending from? PPC, Windows Mobile? or CE?

    I know when I was using the emulator, I had to do a soft reset after
    installing msmq in order for it to start. Can you verify that MSMQ is
    indeed running? (use the msmqadm.exe tool or visadm.exe gui tool)
     
    joker, Feb 23, 2007
    #4
  5. shikha meena

    shikha meena Guest

    Hi,
    I am working on the Pocket PC ... I had a look at the log file
    msmqadmio.txt - which had following txt -

    Windows CE 5.01 (Build 422, 3) - MSMQ 4.2002 (Build 0), MSMQ_CE
    DISCONNECTED

    I also tried visadm.exe gui tool on the PPC .. Through the shortcuts
    in the visadm.exe i clicked on the start and then looked at the status
    which is showing the same line

    Windows CE 5.01 (Build 422, 3) - MSMQ 4.2002 (Build 0), MSMQ_CE
    DISCONNECTED

    Could you please guide how can i resolve this....

    Thanks...

    Shikha
     
    shikha meena, Feb 23, 2007
    #5
  6. shikha meena

    joker Guest

    Not sure, but it doesn't sound like mq is running. I use the
    msmqadm.exe command line tool, but you can use visadm tool to do the
    same thing. The following is what I type to get mq running.

    msmqadm register cleanup
    msmqadm register install
    msmqadm register
    msmqadm start

    I'm not sure why, but I always get an error on the 3rd line, but if I
    don't do it, mq doesn't start.

    Also, make sure that you have a hostname defined. I think the device
    name or device id will work, otherwise change the HostName registry
    entry (the msmq value) to set it.
     
    joker, Feb 23, 2007
    #6
  7. shikha meena

    shikha meena Guest

    Hi ,

    II have found the log file msmq - MQLOGFILE.TXT and in that following
    text is written:

    [11:55:21 2/24/2007] MSMQ service started.

    So it is confirmed that the MSMQ is running ... The device name on the
    PPC is set .. Do u think it is still required to change the Hostname
    registry entry. If yes then where can i set it and what value should i
    set it to.


    Thanks,
    Shikha
     
    shikha meena, Feb 24, 2007
    #7
  8. shikha meena

    joker Guest

    What status do you get when you run the visadm status command?
     
    joker, Feb 24, 2007
    #8
  9. shikha meena

    shikha meena Guest

    Status remains the same in visadm

    Windows CE 5.01 (Build 422, 3) - MSMQ 4.2002 (Build 0), MSMQ_CE
    DISCONNECTED
     
    shikha meena, Feb 24, 2007
    #9
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alberto Silva

    Re: Device Connection Issue - Be sure device is physically connected...

    Alberto Silva, Sep 9, 2003, in forum: Microsoft Dot NET Compact Framework
    Replies:
    0
    Views:
    233
    Alberto Silva
    Sep 9, 2003
  2. Alberto Silva

    Re: Device Connection Issue - Be sure device is physically connected... QUESTION

    Alberto Silva, Sep 9, 2003, in forum: Microsoft Dot NET Compact Framework
    Replies:
    0
    Views:
    227
    Alberto Silva
    Sep 9, 2003
  3. Guest

    MSMQ WM 5.0 Message Size Limit

    Guest, Jan 5, 2006, in forum: Microsoft Dot NET Compact Framework
    Replies:
    3
    Views:
    1,925
    Guest
    Mar 21, 2006
  4. Dariusz

    Read message from desktop MSMQ queue.

    Dariusz, Feb 10, 2006, in forum: Microsoft Dot NET Compact Framework
    Replies:
    7
    Views:
    678
    Dariusz
    Feb 13, 2006
  5. Adam Bradley

    Q: Accessing MSMQ on WinXP Pro from a docked WM5 device

    Adam Bradley, Oct 5, 2006, in forum: Microsoft Dot NET Compact Framework
    Replies:
    12
    Views:
    2,395
    folk007
    Apr 19, 2012
Loading...

Share This Page