errors on parameter passing" /> Parameter passing

 

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.