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 » C++ coding

Post new topic  Reply to topic
 C++ coding « View previous topic :: View next topic » 
Author Message
lakshmin
PostPosted: Thu Dec 12, 2002 3:34 am    Post subject: C++ coding Reply with quote

Newbie

Joined: 12 Dec 2002
Posts: 4

Hi All
I have copied the code from the sample. I have built the exe and ran the exe. it is gving this error.
ImqQueueManager::connect failed with reason code 2058
ImqQueue::open ended with reason code 2058
unable to open queue for input

My QueueManager is existing.do i have to do special setup.
When i use my C code it is connecting to the same QueueManager.

PPlease advise me.

Lakshmi.
Back to top
View user's profile Send private message
mgrabinski
PostPosted: Thu Dec 12, 2002 3:48 am    Post subject: Reply with quote

Master

Joined: 16 Oct 2001
Posts: 246
Location: Katowice, Poland

Hi,

Double check the spelling - MQSeries is case sensitive.
If have a default queue manager, you can connect with blank queue manager name
_________________
Marcin Grabinski <><
Back to top
View user's profile Send private message
lakshmin
PostPosted: Thu Dec 12, 2002 4:25 am    Post subject: 2058 Connection error in C++ Reply with quote

Newbie

Joined: 12 Dec 2002
Posts: 4

HI

Still same problem . I have checked the spelling . still i am not able to connect.

If i use the MQCONN i am able to do it. But not through C++. please give me answer for this.

Lakshmi.
Back to top
View user's profile Send private message
clindsey
PostPosted: Thu Dec 12, 2002 7:29 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

I suspect that you linked with client libraries and you do not have a channel specified (i.e. MQSERVER).
Go to the c++ sample directory, <mqtop>\tools\cplus\samples\bin\vn.
Note there is an amqsputs.exe and an amqsputc.exe for server binding and client bindings respectively.
Try both of these from the server. You will find that amqsputs works for you but amqsputc fails with 2058.
The difference between these 2 exes is the libs they are linked with. Always link with imqb23vn.lib.
Then for client bindings, also link with imqs23vn.lib or for server bindings link with imqs23vn.lib

Charlie
Back to top
View user's profile Send private message
dunesand
PostPosted: Fri Dec 05, 2003 6:56 am    Post subject: Reply with quote

Acolyte

Joined: 17 Nov 2003
Posts: 65
Location: Cambridgeshire, UK

I've got the same problem, and the last posting correctly solves the issue.

However, I'm creating a COM interface that I need to work on both clients and servers alike... surely the C++ API doesn't restrict you to using it either on a MQ Series Server or MQ Series client???

How would I go about this, with this approach?

I'm using Websphere MQ 5.3 (with the version 5 update)[/b]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JasonE
PostPosted: Fri Dec 05, 2003 7:39 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Yes, the C++ bindings are client or server specific. The .Net and ActiveX interfaces can swap, and you can call the C layer by manually loading the correct DLL and extracting the entrypoints (after all there isnt that many...).
Back to top
View user's profile Send private message
dunesand
PostPosted: Mon Dec 08, 2003 3:33 am    Post subject: Reply with quote

Acolyte

Joined: 17 Nov 2003
Posts: 65
Location: Cambridgeshire, UK

Quote:
and you can call the C layer by manually loading the correct DLL and extracting the entrypoints (after all there isnt that many...).


How do i go about doing this?
Is it complicated?
would this provide a solution not client/server dependent?

thanks!

Dan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JasonE
PostPosted: Mon Dec 08, 2003 4:03 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

For C functions, look in the software repository, eg. ntloadmq. I think there is examples for other o/s's as well. It wont help you if you are doing C++ code though - The only way I could see you doing this is to build all your C++ code into a shared library built twice, once linking with client and once with server bindings. Then you have some code which loads the appropriate one of your shared libraries depending on whether mqm.dll can be found (or the unix equivalent). Its not nice, and I am only guessing this could work.
Back to top
View user's profile Send private message
dunesand
PostPosted: Mon Dec 08, 2003 4:07 am    Post subject: Reply with quote

Acolyte

Joined: 17 Nov 2003
Posts: 65
Location: Cambridgeshire, UK

yeah i see what you're saying...

it's not that clean, but will work.

Thanks for that idea.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JasonE
PostPosted: Mon Dec 08, 2003 4:32 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Just be slightly careful - In our code we generally assume if mqm.dll is found that server bindings are required, but that is not always true, so we end up having environment variables to override this behaviour in those cases, ie explicitly use client bindings.
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 » IBM MQ API Support » C++ coding
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.