tags:

views:

122

answers:

1

I am using MSMQ.MSMQQueueInfo with jscript on Windows 7 (the latest MSMQ version). This is being run on a domain joined computer. For some reason unknown to me, it just will not accept the PathName I give it (which is in an acceptable format). Here is the code:

var qi = new ActiveXObject ("MSMQ.MSMQQueueInfo");
qi.PathName = "FormatName:Direct=OS:mycomputer\\Private$\\myqueue";

I know this PathName works, because I use the exact same path in c#, and that works:

queue = new MessageQueue("FormatName:DIRECT=OS:" + contollerName + "\\Private$\\" + queueName);

When the code "qi.Open()" in the jscript code attempts to execute, it returns this error message: The queue path name specified is invalid.

Has anyone else run into this? Ideas? Comments? Suggestions? Thank you in advance!

+1  A: 

You are using the wrong parameter for accessing a remote private queue:

MSMQQueueInfo.PathName http://msdn.microsoft.com/en-us/library/ms707110(v=VS.85).aspx "However, the MSMQQueueInfo.FormatName property must be set with a direct format name to open a remote private queue."

Cheers
John Breakwell

John Breakwell
Wow, thank you so much for your fast response! You are correct, there is a FormatName property that I completely did not see. I used that property and now the test works! Thanks a bunch!
Jeff