Reading Messages from a Queue

Messages can be read from a queue on the same Windows CE device or on another computer. You need to have a valid network connection to the other computer to read from a remote queue. To read one or more messages from a queue, you must do the following:

  • Open the queue using MQOpenQueue
  • Initialize a MQMSGPROPS structure in which the message will be received
  • Call MQReceiveMessage (Table 15.3) to read a message, if one is present
  • Close the queue when finished reading messages by calling MQCloseQueue

The minimum properties needed to pass to MQReceiveMessage are the following:

  • PROPID_M_BODY_SIZE— Property receives the number of bytes in the message body

  • PROPID_M_BODY— Property receives the message body data

The ...

Get Windows® CE 3.0 Application Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.