ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » VB6 and MQ v7

Post new topic  Reply to topic
 VB6 and MQ v7 « View previous topic :: View next topic » 
Author Message
cbr
PostPosted: Tue Sep 07, 2010 1:40 am    Post subject: VB6 and MQ v7 Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Sep 07, 2010 4:08 am    Post subject: Re: VB6 and MQ v7 Reply with quote

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
View user's profile Send private message
cbr
PostPosted: Wed Sep 29, 2010 11:43 pm    Post subject: Problem with call from MQ Client. Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Sep 30, 2010 4:20 am    Post subject: Re: Problem with call from MQ Client. Reply with quote

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
View user's profile Send private message
cbr
PostPosted: Thu Sep 30, 2010 4:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Sep 30, 2010 4:44 am    Post subject: Reply with quote

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
View user's profile Send private message
cbr
PostPosted: Thu Sep 30, 2010 4:47 am    Post subject: Reply with quote

Newbie

Joined: 07 Sep 2010
Posts: 4

OK - I'll do that.

Thanks again for the quick answers.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Sep 30, 2010 4:51 am    Post subject: Reply with quote

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
View user's profile Send private message
gbaddeley
PostPosted: Thu Sep 30, 2010 4:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » VB6 and MQ v7
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.