MSMQ - Send Message Issue from device to PC

S

shikha meena

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
 
J

joker

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.
 
S

shikha meena

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
 
J

joker

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)
 
S

shikha meena

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
 
J

joker

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.
 
S

shikha meena

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
 
S

shikha meena

Status remains the same in visadm

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top