Author |
Message
|
lakshmin |
Posted: Thu Dec 12, 2002 3:34 am Post subject: C++ coding |
|
|
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 |
|
 |
mgrabinski |
Posted: Thu Dec 12, 2002 3:48 am Post subject: |
|
|
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 |
|
 |
lakshmin |
Posted: Thu Dec 12, 2002 4:25 am Post subject: 2058 Connection error in C++ |
|
|
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 |
|
 |
clindsey |
Posted: Thu Dec 12, 2002 7:29 am Post subject: |
|
|
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 |
|
 |
dunesand |
Posted: Fri Dec 05, 2003 6:56 am Post subject: |
|
|
 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 |
|
 |
JasonE |
Posted: Fri Dec 05, 2003 7:39 am Post subject: |
|
|
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 |
|
 |
dunesand |
Posted: Mon Dec 08, 2003 3:33 am Post subject: |
|
|
 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 |
|
 |
JasonE |
Posted: Mon Dec 08, 2003 4:03 am Post subject: |
|
|
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 |
|
 |
dunesand |
Posted: Mon Dec 08, 2003 4:07 am Post subject: |
|
|
 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 |
|
 |
JasonE |
Posted: Mon Dec 08, 2003 4:32 am Post subject: |
|
|
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 |
|
 |
|