About WebSphere MQ Automation Classes for ActiveX classes

This information should be read in conjunction with the WebSphere MQ Application Programming Referencemanual.

The MQSession class provides a root object that contains the status of the last action performed on any of the MQAX objects. See Error handling for more information.

The MQQueueManager and MQQueue classes provide access to the underlying WebSphere MQ objects. Methods or property accesses for these classes in general result in calls being made across the WebSphere MQ MQI.

The MQMessage, MQPutMessageOptions, and MQGetMessageOptions classes encapsulate the MQMD, MQPMO, and MQGMO data structures respectively, and are used to help you send messages to queues and retrieve messages from them.

The MQDistributionList class encapsulates a collection of queues - local, remote, or alias for output. The MQDistributionListItem class encapsulates the MQOR, MQRR, and MQPMR structures and associates them with an owning distribution list.

These classes can be found in the MQAX200 library.

Parameter passing

Parameters on method invocations are all passed by value, except where that parameter is an object, in which case it is a reference that is passed.

The class definitions provided list the Data Type for each parameter or property. For many ActiveX clients, such as Visual Basic, if the variable used is not of the required type, the value is automatically converted to or from the required type - providing such a conversion is possible. This follows standard rules of the client; MQAX provides no such conversion.

Many of the methods take fixed-length string parameters, or return a fixed-length character string. The conversion rules are as follows:

Object access methods

These methods do not relate directly to any single WebSphere MQ call. Each of these methods creates an object in which reference information is then held, followed by connecting to or opening a WebSphere MQ object:

When a connection is made to a queue manager, it holds the 'connection handle' generated by WebSphere MQ.

When a queue is opened, it holds the 'object handle' generated by WebSphere MQ.

These WebSphere MQ attributes are explained in the WebSphere MQ Application Programming Reference manual. They are not directly available to the MQAX program.

Errors

Syntactic errors on parameter passing may be detected at compile time and run time by the ActiveX client. Errors can be trapped using On Error in Visual Basic.

The WebSphere MQ ActiveX classes all contain two special read-only properties - ReasonCode and CompletionCode. These can be read at any time.

An attempt to access any other property, or to issue any method call could potentially generate an error from WebSphere MQ.

If a property set or method invocation succeeds, the owning object's ReasonCode and CompletionCode fields are set to MQRC_NONE and MQCC_OK respectively.

If the property access or method invocation does not succeed, reason and completion codes are set in these fields.



© IBM Corporation 2002. All Rights Reserved