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 » IBM MQ API Support » Using MQ API calls in VB.NET

Post new topic  Reply to topic
 Using MQ API calls in VB.NET « View previous topic :: View next topic » 
Author Message
MillsPerry
PostPosted: Wed Jun 18, 2003 9:39 am    Post subject: Using MQ API calls in VB.NET Reply with quote

Acolyte

Joined: 08 Oct 2001
Posts: 59
Location: ZyQuest, inc.

I am trying to write a VB.NET class that uses the MQ API. I took some code that works in VB6, did all the obvious conversions like changing Longs to Int32, but it does not work in VB.NET.

For example, I try a MQCONN call using the attached code sample, but all I get is a reason code of 2058 (MQRC_Q_MGR_NAME_ERROR). Since I am obviously communicating with MQSeries, I suppose that the API does not like the string format of the QMgr name. Can anybody tell me what I am doing wrong?

Code:
Module Module1
    Private Declare Auto Sub MQCONN _
            Lib "C:\Program Files\MQSeries Client\bin\MQIC32.DLL" _
            Alias "MQCONNstd@16" (ByRef QMgrName As String, ByRef Hconn As Int32, _
            ByRef CompCode As Int32, ByRef Reason As Int32)

    Sub Main()
      Dim intCompCode, intRC, intHandle As Int32
      MQCONN("MyQMgrName", intHandle, intCompCode, intRC)
     End Sub
End Module


PS. To head off the obvious replys; Yes, I know about IBM's DotNet service pack. No, I am not interested in using it, nor am I interested in COM interop. I just want to know how to use the old API.

Thanks!
Back to top
View user's profile Send private message Send e-mail
MillsPerry
PostPosted: Thu Aug 07, 2003 7:07 am    Post subject: Reply with quote

Acolyte

Joined: 08 Oct 2001
Posts: 59
Location: ZyQuest, inc.

Solved the problem by running a working VB6 program through the upgrade wizard.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Using MQ API calls in VB.NET
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.