Creating a Message Queue

When you create a message queue you get a fixed size buffer for queueing short messages. Every short message has an overhead of 34 bytes in the buffer that needs to be considered when you specify dwQueueSize.
 
The maximum size of a short message is set by dwMsgThreshold. This is an arbitrary value which determines the method used to send the message:
  • A short message is directly stored in the buffer and can be received later.
  • Messages longer than dwMsgThreshold will be delivered as long messages. The sender of a long message is blocked until the receiver provides a buffer long enough to hold this message.
A value of 0 will force all messages to be sent as long messages.
 
Choose the values to meet the requirements of your application. Typically, dwMsgThreshold is the size of your “normal” messages. Messages longer than the threshold will be sent as a long message.