Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.2 KiB

  1. =============
  2. MSMQ API Test
  3. =============
  4. MQAPITST.EXE is an MFC MSMQ application that can be used to test
  5. and experiment MSMQ C api.
  6. Requirements:
  7. MSMQ 1.0 or Msmq 2.0 DS-enabled must be installed .
  8. This sample is not designed to execute on DS-disabled computer.
  9. Using MQAPITST.EXE you can test the following API calls:
  10. - MQCreateQueue
  11. - MQDeleteQueue
  12. - MQOpenQueue
  13. - MQCloseQueue
  14. - MQSendMessage
  15. - MQReceiveMessage
  16. - MQLocate (MQLocate calls the three locate APIs: MQLocateBegin,
  17. MQLocateNext, and MQLocateEnd)
  18. Note
  19. Before you can open a queue using Mqapitst.exe, you must use MQLocate
  20. to located the queue. Mqapitst.exe locates queues based on their
  21. labels. Also, if you are using one instance of Mqapitst.exe, you cannot send
  22. messages to and receive messages from the same queue without first
  23. closing the queue handle. For example, if you open the queue for send
  24. and send five messages, you cannot read the messages without first
  25. closing your handle to the queue, and then opening the queue for read.
  26. The main source file for the program, where the menus are invoked and
  27. the MSMQ APIs are called, is Mainfrm.cpp.
  28. When building Mqapitst on Windows 95, only ANSI configurations should be used.
  29. For more information, see the MSMQ SDK help file.
  30. The following procedure shows you how to use MSMQ API Test to
  31. become familiar with and experiment with the MSMQ APIs.
  32. To see MSMQ functionality using MSMQ API Test:
  33. 1. Run two instances of MSMQ API Test (Mqapitst.exe), either on one
  34. computer, or two different computers.
  35. 2. Create a queue in one application, entering the Pathname (for
  36. example, "YourMachine\MyQueue") and the Label (for example,
  37. "MQ API Test") of the queue.
  38. 3. Locate the queue in the other instance of MSMQ API Test.
  39. You can do this by using the MQLocate API to search for the
  40. queue's label.
  41. 4. In one instance of MSMQ API Test open the queue for Send.
  42. 5. In the other MSMQ API Test open the queue for Receive.
  43. 6. Send and Receive messages between the applications.
  44. Experiment with the various send options, such as message
  45. priority, message time-to-reach-queue, time-to-be-received,
  46. acknowledgements, and delivery modes.
  47. 7. Close and then delete the queues.