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 » General Discussion » API that combines MQCONN and MQOPEN

Post new topic  Reply to topic
 API that combines MQCONN and MQOPEN « View previous topic :: View next topic » 
Author Message
gerofrancis
PostPosted: Sat May 07, 2005 6:33 am    Post subject: API that combines MQCONN and MQOPEN Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sat May 07, 2005 10:16 am    Post subject: Reply with quote

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
View user's profile Send private message
gerofrancis
PostPosted: Sat May 07, 2005 5:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Mon May 09, 2005 5:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » API that combines MQCONN and MQOPEN
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.