Hello,
Great Question. I had the same problem and was also frustrated with the
lack of postings.
The problem is the MessageQueue.FormatName is now read-only in .net.
In the good old days of COM msmq, one could use the:
MSMQQueueInfo.FormatName = "DIRECT=OS:MyServer\private$\someQ"
where "MyServer" is a remote machine name. You had to do it this was for remote
machines. MSMQQueueInfo.pathname would bomb when trying to access private queues from remote machines.
In .net, it still bombs;however, MessageQueue doesn't expose a write property for .FormatName.
That sucks!!!
The answer, which works in .net, not COM msmq is:
//c# code begin==========================
string lsTemp = @"FormatName:DIRECT=OS:MyServer\private$\someQ" ;
if (mQueue == null)
mQueue = new MessageQueue(lsTemp);
//c# code end==============================
where MyServer is the UNC name of some remote computer & someQ is a private queue on MyServer.
Remember, for COM MSMQ, you have to
vb6 code begin===================
mMSMQQueueInfo.FormatName = "DIRECT=OS:MyServer\private$\someQ"
vb6 code end ===================
In summary, in vb6 ALWAYS USE THE .FORMATNAME property over the PATHNAME property.
In .net, use the "FormatName:DIRECT=OS:" prefix in the constructor as seen above.
I hope this helps.
whattheheck
whattheheck in the house
|