Problem:
The example project MSMQLE works fine in NET Express but transfering it to a Visual Studio project it does not compile. Are there any instructions for doing this or is there a .NET example of using MSMQ available?
Resolution:
The MSMQOLE demo will not compile in Visual Studio as it consists of calls to unmanaged code -- the win32 APIs and the MSMQ objects, for instance.
In .NET, you would add a reference to the managed System.Messaging .NET object. Please see the attached demo, which simply sends a message to a Private queue called 'MSMQTest'. If you change the 'QueuePathName' in the MSMQTEST.CBL source file in the MSMQOLE demo to have this 'MSMQTest' private queue receiving the messages, you can run the demo as a receiver and the message from the .NET sample will be displayed in the output window of the MSMQOLE demo. Otherwise it will be there in the Queue messages for the 'MSMQTest' private queue.
Changing the QueuePathName:
move z".\\Private$\\MSMQTest" to QueuePathName
invoke QueueInfo "setPathName"
using QueuePathName