|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
API that combines MQCONN and MQOPEN |
« View previous topic :: View next topic » |
Author |
Message
|
gerofrancis |
Posted: Sat May 07, 2005 6:33 am Post subject: API that combines MQCONN and MQOPEN |
|
|
Newbie
Joined: 07 May 2005 Posts: 2
|
Can anyone check my code please if correct? MQCONN_OPEN API. I welcome comments and suggestions. Thanks.
void MQCONN_OPEN( MQCHAR pName , MQHCONN pHconn, PMQVOID pObjDes, MQLONG Options, MQHOBJ pHobj, MQLONG pCompCode, MQLONG pReason)
{
MQCONN(pName, &pHconn, &pCompCode, &pReason);
if(pCompCode == MQCC_FAILED){
return;
}
else {
MQOPEN( pHconn, &pObjDes, Options, &pHobj, &pCompCode, &pReason);
}
}
int main (int argc, char** argv)
{
MQLONG CompCode;
MQLONG Reason;
MQHCONN Hcon;
MQOD od = {MQOD_DEFAULT}; MQLONG CO_options;
MQHOBJ Hobj;
char QMName[50];
strcpy(QMName, "MyQManager");
O_options = MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING;
MQCONN_OPEN(QMName, &Hcon, &od, CO_options, &Hobj, &CompCode, &Reason);
if (Reason != MQRC_NONE) {
printf("MQCONN_OPEN ended with reason code %ld\n", Reason);
}
...
......
.....
....
...
..
.
return 0;
} |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat May 07, 2005 10:16 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What error do you get when you run this code? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
gerofrancis |
Posted: Sat May 07, 2005 5:21 pm Post subject: |
|
|
Newbie
Joined: 07 May 2005 Posts: 2
|
Hi!
Actually, i do not have any MQ series installed in the system. The code is purely theoretical. I just need it at work. Can you check please if the parameters passed for MQCONN_OPEN are correct? How about the use of & for every parameter passed?
Pls help cuz i'm just a new bie in MQ Series.
Thanks in advance. !  |
|
Back to top |
|
 |
bower5932 |
Posted: Mon May 09, 2005 5:36 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Just out of curiosity, how are you going to tell if the MQCONN failed or the MQOPEN failed? If the MQOPEN fails, you'll still want to do the MQDISC at the end of your program. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|