Sample applications

Three sample applications are supplied:

"Put message" program SPUT (nmqsput.cs, mmqsput.cpp, vmqsput.vb)
This program shows how to put a message to a named queue. The program has 3 parameters: If no queue manager name is given, the queue manager defaults to the default local queue manager. If a channel is defined, it should have the same format as the MQSERVER environment variable.
"Get message" program SGET (nmqsget.cs, mmqsget.cpp, vmqsget.vb)
This program shows how to get a message from a named queue. The program has 3 parameters: If no queue manager name is given, the queue manager defaults to the default local queue manager. If a channel is defined, it should have the same format as the MQSERVER environment variable.
"Hello World" program (nmqwrld.cs, mmqwrld.cpp, vmqwrld.vb)
This program shows how to put and get a message. The program has 3 parameters: If no queue name is given, the name defaults to SYSTEM.DEFAULT.LOCAL.QUEUE. If no queue manager name is given, the queue manager defaults to the default local queue manager.

You can verify your installation by compiling and running these applications.

The sample applications will be installed to the following locations, according to the language in which they are written, where mqmtop represents the high-level directory in which the product has been installed:

C#

mqmtop\Tools\dotnet\samples\cs\nmqswrld.cs

mqmtop\Tools\dotnet\samples\cs\nmqsput.cs

mqmtop\Tools\dotnet\samples\cs\nmqsget.cs

Managed C++

mqmtop\Tools\dotnet\samples\mcp\mmqswrld.cpp

mqmtop\Tools\dotnet\samples\mcp\mmqsput.cpp

mqmtop\Tools\dotnet\samples\mcp\mmqsget.cpp

Visual Basic

mqmtop\Tools\dotnet\samples\vb\vmqswrld.vb

mqmtop\Tools\dotnet\samples\vb\vmqsput.vb

mqmtop\Tools\dotnet\samples\vb\vmqsget.vb

mqmtop\Tools\dotnet\samples\vb\xmqswrld.vb

mqmtop\Tools\dotnet\samples\vb\xmqsput.vb

mqmtop\Tools\dotnet\samples\vb\xmqsget.vb

To build the sample applications a batch file has been supplied for each language.

C#

mqmtop\Tools\dotnet\samples\cs\bldcssamp.bat

The bldcssamp.bat file contains a line for each sample, which is all that is necessary to build this sample program:

csc /t:exe /r:System.dll /r:amqmdnet.dll /lib:mqmtop\bin 
/out:nmqwrld.exe nmqwrld.cs
Managed C++

mqmtop\Tools\dotnet\samples\mcp\bldmcpsamp.bat

The bldmcpamp.bat file contains a line for each sample, which is all that is necessary to build this sample program:

cl /clr mqmtop\bin mmqwrld.cpp
Visual Basic

mqmtop\Tools\dotnet\samples\vb\bldvbsamp.bat

The bldvbsamp.bat file contains a line for each sample, which is all that is necessary to build this sample program:

vbc /r:System.dll /r:mqmtop\bin\amqmdnet.dll /out:vmqwrld.exe vmqwrld.vb