Has anyone recompiled a VB app that uses the MQCI_NEW_SESSION value, with
MQ release 5.3 ??

I think the VB module cmqb.bas supplied with MQ has changed between 5.2 and
5.3; I can't get VB apps to compile when referencing certain variables.
I've tried a few things to get around the compile errors and I get run time
errors.

The variables are those that are byte arrays.. MQCI_NEW_SESSION is one.

It used to be defined as PUBLIC MQCI_NEW_SESSION As String * 24, and then
in the SET_MQDEFAULTS routine, it was set = to a hardcoded string value.

In the v5.3 version, it is defined as PUBLIC MQCI_NEW_SESSION As MQBYTE24,
which is a user defined type, defined as MQBYTE(0 to 23). The
MQQCI_MEW_SESSION is set, in the MQ_SETDEFAULTS, byte by byte to the
hardcoded string value.

When I try to use that in my code,
ex:
oMQMsg.CorrelationID = MQCI_NEW_SESSION

I get the following error:

Compile Error:

Only user-defined types defined in public object modules can be coerced to
or from a variant or passed to late-bound functions.

When I explicitly extract every byte from MQCI_NEW_SESSION, and string them
into a new string variable and assign that,
ex:
s1 = ""
For i1 = 0 to 23
  s1 = s1 & MQCI_NEW_SESSION.MQBYTE(i1)
Next
oMQMsg.CorrelationID = s1

 it compiles ok but I get a runtime error

Run-time error '32000'
MQAX200.MQMessage::SetCorrelationID CompletionCode = 2, ReasonCode = 6111,
ReasonName = MQRC_BINARY_DATA_LENGTH_ERROR.

I don't understand the length error.. the field is defined as an array of
24 bytes, and thats how many times I append to the string. I've preset it
to null, so there are not any extra characters.. I've called the
MQ_SETDEFAULTS routine first..

Thanks in advance
Peter

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Reply via email to