Upgrading from Beta2
The following modifications were made to the ActiveX object model between Beta2 and Beta2E preliminary releases. These changes are relevant to Beta2 clients who are upgrading directly from Beta2 to MSMQ 1.0.
MSMQQueue
-
New PeekCurrent method: This new method reads the message at the current cursor position.
-
lReceiveTimeout is no longer a property: This property is now a parameter for Peek, PeekNext, PeekCurrent, Receive, ReceiveCurrent, and EnableNotification.
-
New ReceiveCurrent method: This replaces ReceiveNext, which has been removed.
-
ReceiveCurrent, PeekCurrent, and PeekNext all use the implied cursor. Peek and Receive do not.
-
EnableNotification has new MQMSG enumeration parameters: MQMSG_FIRST, MQMSG_CURRENT or MQMSG_NEXT.
-
MQMSG_FIRST: This user-defined event handler is invoked whenever there is a message in queue or a time-out occurs. The cursor is not used.
-
MQMSG_CURRENT: This user-defined event handler is invoked whenever there is a message at the current cursor position or a time-out occurs.
-
MQMSG_NEXT: This user-defined event handler is invoked whenever there is a message at the (new) cursor position or a time-out occurs. The cursor is advanced.
-
DisableNotification has been removed.
-
Synchronous read methods Peek, PeekNext, PeekCurrent, Receive, and ReceiveCurrent no longer use the MQ_ERROR_IO_TIMEOUT error. Instead, a NULL message object is returned if a time-out occurs. Use the following idiom to test for the end of the queue: "not msg is nothing".
Note Asynchronous read methods still can use the MQ_ERROR_IO_TIMEOUT error (the MSMQEvent.ArrivedError event handler is invoked).
MSMQQuery
-
LookupQueue takes additional optional restriction parameters:
CreateTime (RelCreateTime) and ModifyTime (RelModifyTime).
Note The default REL_EQ relational operator is not very useful for these two parameters.
MSMQMessage
-
The body property can now be any intrinsic Variant, including date, currency, and numbers (in addition to strings, byte arrays, and persistent objects).
-
New properties SentTime and ArrivedTime are Variant dates instead of lSentTime and lArrivedTime, which have been removed.
-
New AttachCurrentSecurityContext method replaces lSecurityContext property.
MSMQQueueInfo
-
New properties: CreateTime and ModifyTime are Variant dates. Use these properties instead of lCreateTime, strCreateTime, lModifyTime and strModifyTime, which have been removed.
-
New Create optional parameter: IsWorldReadable. The default is False. The default MSMQ security is used where all users can send to the queue, but only the owner can read from the queue. When True, any user can read from the queue.
-
New Boolean read-only property: IsWorldReadable. True indicates that everyone can read from the queue. False indicates that only the owner can read messages from the queue.
Note The IsWorldReadable property is not cached because other applications can dynamically change the state of the queue.
MSMQCoordinatedTransactionDispenser
-
This is simply a renaming of the old MSMQTransactionDispenser. This object dispenses MS DTC transactions.
MSMQTransactionDispenser
-
A new object that dispenses MSMQ-only transactions.
MSMQTransaction
-
A new read-only property: Transaction. It exposes the actual ITransaction* magic cookie internally used by the BeginTransaction method from either of the dispenser objects. This property can be used to pass to other components such as Microsoft SQL Server.
Transactions with Microsoft Transaction Server (MTS)
When sending messages to a transactional queue, the MSMQMessage object's Send method takes an optional MSMQTransaction object parameter. The parameter can be one of the following:
-
An actual MSMQTransaction object, as obtained from BeginTransaction.
-
If no parameter is supplied, any current MTS transactions will be used.
-
MQ_NO_TRANSACTION: This is an error if the target queue is transactional. Otherwise, it overrides the default MTS transaction.
-
MQ_XA_TRANSACTION: Uses current default XA transaction, if any.
-
MQ_MTS_TRANSACTION: Explicitly uses the current MTS transaction.
-
MQ_SINGLE_MESSAGE: Uses internal MSMQ transaction semantics for the message.
MSMQApplication Object
-
New object: "application object." A single instance of this class is automatically created by MSMQ. Its methods are all in the global name space (that is, they do not require object qualification).
-
Its only current method, MachineIdOfMachineName, is used to construct the format name of a computer journal queue so that it can be opened.
MSMQMailTnefData Object
-
New object that defines a TNEF message. The MSMQMailTnefData object has a single Data property and no methods.
MSMQMailDeliveryReportData Object
MSMQMailNonDeliveryReportData Object