Author |
Message
|
cbr |
Posted: Tue Sep 07, 2010 1:40 am Post subject: VB6 and MQ v7 |
|
|
Newbie
Joined: 07 Sep 2010 Posts: 4
|
Hi
I'm using VB6 and MQ v5.3 today, but wan't to upgrade MQ to v7.
Is it possible to use MQ v7 with VB6-programs?
 |
|
Back to top |
|
 |
Vitor |
Posted: Tue Sep 07, 2010 4:08 am Post subject: Re: VB6 and MQ v7 |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cbr wrote: |
Is it possible to use MQ v7 with VB6-programs? |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cbr |
Posted: Wed Sep 29, 2010 11:43 pm Post subject: Problem with call from MQ Client. |
|
|
Newbie
Joined: 07 Sep 2010 Posts: 4
|
When I try to GET from a MQ Client (MqType = 2), I get this error:
Quote: |
MQSeries Completion Code = 57298784, MQSeries Reason Code = 2
|
I'm using mqax200.dll in my VB6-program - this is the code that I'm using:
Code: |
90 Set GetMsg = MQSess.AccessMessage()
100 GetMsg.MessageType = MQMT_DATAGRAM
110 GetMsg.PutApplicationType = MQAT_NO_CONTEXT
120 GetMsg.PutApplicationName = ""
130 GetMsg.CorrelationId = ""
140 GetMsg.MessageId = ""
150 Set GetOptions = MQSess.AccessGetMessageOptions()
160 GetOptions.Options = MQGMO_WAIT Or MQGMO_CONVERT Or MQGMO_ACCEPT_TRUNCATED_MSG
170 GetOptions.WaitInterval = 1000 '1 second
180 GetMsg.Encoding = MQENC_NATIVE
190 GetMsg.CharacterSet = MQCCSI_Q_MGR
200 Queue.Get GetMsg, GetOptions
210 BECStr = GetMsg.MessageData
|
Line 200 is where the trouble starts.
Can somebody tell me what the Completion Code means?
Is something wrong with the code listed above?
I'm upgrading MQ from v5.3 to v7 and don't know how much the VB6-code has to change to work with v7. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 30, 2010 4:20 am Post subject: Re: Problem with call from MQ Client. |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cbr wrote: |
I'm using mqax200.dll in my VB6-program |
I'd use the libraries rather than the ActiveX with post v5.3. That control's been stabalised for a while now.
cbr wrote: |
Can somebody tell me what the Completion Code means? |
It means you have the high and low order bytes reversed.
cbr wrote: |
Is something wrong with the code listed above? |
Not in concept.
cbr wrote: |
I'm upgrading MQ from v5.3 to v7 and don't know how much the VB6-code has to change to work with v7. |
I don't recall many methods changing names, but I never used the ActiveX control. That control was stabalised when v6 came out and you should switch away from that. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cbr |
Posted: Thu Sep 30, 2010 4:33 am Post subject: |
|
|
Newbie
Joined: 07 Sep 2010 Posts: 4
|
Vitor - thanks for your replies.
Do you know how to convert a string to MQBYTE24?
I can't find an example "anywhere".
This is the primary reason I wan't to stick with the ActiveX.
I have 2 statements:
Code: |
160 PutMsg.CorrelationId = Left(Now & Space(24), 24)
170 PutMsg.MessageId = Left(MsgId & Space(24), 24)
|
These 2 statements won't compile when I use the libraries:
Code: |
25 md.CorrelId = Left(Now & Space(24), 24)
26 md.MsgId = Left(MsgId & Space(24), 24)
|
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 30, 2010 4:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cbr wrote: |
I have 2 statements:
Code: |
160 PutMsg.CorrelationId = Left(Now & Space(24), 24)
170 PutMsg.MessageId = Left(MsgId & Space(24), 24)
|
These 2 statements won't compile when I use the libraries:
Code: |
25 md.CorrelId = Left(Now & Space(24), 24)
26 md.MsgId = Left(MsgId & Space(24), 24)
|
|
There are any number of discussions on why setting message id or correl id manually is a bad idea in any language. Stop doing it & abandon the ActiveX. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cbr |
Posted: Thu Sep 30, 2010 4:47 am Post subject: |
|
|
Newbie
Joined: 07 Sep 2010 Posts: 4
|
OK - I'll do that.
Thanks again for the quick answers. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 30, 2010 4:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cbr wrote: |
OK - I'll do that. |
Good call.
If you actually need the time of the message (rather than just using it to try and create uniqueness) there are options open to you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Sep 30, 2010 4:26 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
It looks like ActiveX and VB support is being deprecated in MQ v7 in favour of .NET. ActiveX and cmqb.bas were not updated in MQ v7 to provide the new functionality in that version. _________________ Glenn |
|
Back to top |
|
 |
|