Author |
Message
|
badger2196 |
Posted: Thu Sep 30, 2010 11:13 am Post subject: MQMessage invalid with version 7 of cmqc.h |
|
|
Newbie
Joined: 30 Sep 2010 Posts: 5
|
We have a C++ program that runs fine with version 6 of the cmqc.h header file. However, when using version 7 of this file, the MQMessage pointer returned by MQGET is invalid. cmqc.h is supposed to be backwards compatible - does anyone have any clues as to why the message would be invalid?
We are running MQSeries 6 on 64 bit Windows XP. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 30, 2010 11:23 am Post subject: Re: MQMessage invalid with version 7 of cmqc.h |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
badger2196 wrote: |
However, when using version 7 of this file, the MQMessage pointer returned by MQGET is invalid. |
What other v7 files does this app use? Is it linked with the v7 libraries? I'd see that as more of a possible issue than the header file especially if you're using a client connection. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
badger2196 |
Posted: Thu Sep 30, 2010 11:33 am Post subject: |
|
|
Newbie
Joined: 30 Sep 2010 Posts: 5
|
It only links to mqm.dll which (supposedly) can be V6 or 7. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 30, 2010 11:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
badger2196 wrote: |
It only links to mqm.dll which (supposedly) can be V6 or 7. |
Can it? Where is the "supposedly" coming from? It's worth checking file sizes to see if the same version is shipped with both v6 & v7. Especially as, having re-read my previous post, there seems to have been a problem in the brain/finger typing interface. I know a v7 client can connect to a v6 queue manager, but didn't think you could establish cross version binding connections.
So the "not" I thought I'd typed would have been helpful. It's been a long day.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 30, 2010 11:51 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Okay, don't try and mix and match files between versions when doing compiles.
If you're trying to compile against V6, then use the full v6 set of libs and includes and .h files.
If you're trying to compile against v7, then use the full v7 set of libs and etcetcetc.
It's not otherwise terribly clear what you're really actually doing. .h files really aren't used at runtime... So are you having a compile issue or a runtime issue? |
|
Back to top |
|
 |
badger2196 |
Posted: Fri Oct 01, 2010 8:44 am Post subject: |
|
|
Newbie
Joined: 30 Sep 2010 Posts: 5
|
I'm having the issue at runtime. It turns out the issue is also apparent if I use version 7.0 of the DLL with cmqc.h |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Oct 01, 2010 9:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I do not understand what you mean by using the cmqc.h file at runtime.
I do not understand what you mean by using a DLL with cmqc.h file.
CMQC.h is a header file. It is used at compile time to assist in turning source code into object code, and potentially used during link time to link object code into an executable.
Also, MQ is "forward" compatible, it is not "backwards" compatible. What this means is that it you are allowed to use code that is compiled against an older version of the product without change against a newer version of the product. So if you build your application against MQ v6, it will run against MQ v7. But it is not guaranteed that if you build your application against MQ v7 that it will then run against MQ v6!
If you are specifically experiencing an issue where you have compiled and linked your application against the MQ v6 product, and are getting errors when running it against an MQ v7 install, then you can probably open a PMR.
How, specifically are you using the v7 version of cmqc.h? As I said, you should not be mixing and matching. If you have taken a copy of cmqc.h from a v7 install and put it on a machine with v6, then that won't work. |
|
Back to top |
|
 |
badger2196 |
Posted: Mon Oct 04, 2010 10:46 am Post subject: |
|
|
Newbie
Joined: 30 Sep 2010 Posts: 5
|
Yes, I know what a header file is. What I am trying to convey here is that I can compile my app using V6 of the cmqc.h file and it reads MQ messages just fine. If I compile it using V7 of the header however, I can no longer read MQ messages (and this is true in a V6 or V7 MQ environment). |
|
Back to top |
|
 |
Vitor |
Posted: Mon Oct 04, 2010 10:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
badger2196 wrote: |
If I compile it using V7 of the header however, I can no longer read MQ messages (and this is true in a V6 or V7 MQ environment). |
Some simple and important questions need to be answered:
1) What version of mqm.dll are you linking against?
2) Are you certain you're using a binding connection?
3) Why would you expect an application compiled with v7 anything to work against a v6 queue manager? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 04, 2010 10:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Are you using a full MQ v7 install to build against?
Or are you copying files from a full MQ v7 install onto a build machine?
Are you then running the program against an MQ v7 install? Or an MQ v6 install? |
|
Back to top |
|
 |
badger2196 |
Posted: Mon Nov 01, 2010 10:33 am Post subject: |
|
|
Newbie
Joined: 30 Sep 2010 Posts: 5
|
I have a full MQ V7 system (including mqm.dll) that I am compiling against, but if I compile using the V7 version of cmqc.h I cannot process messages using MQGET. If, strangely enough, I revert back to the V6 version of that header file and re-compile. it all works just fine.
I am running my program against an MQ V7 system. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 01, 2010 10:40 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What is the MQ Reason and Completion Code you receive from your MQGET when compiled against the full v7 library? |
|
Back to top |
|
 |
|