|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
‘MQCD’ was not declared in this scope |
« View previous topic :: View next topic » |
Author |
Message
|
yasaboy |
Posted: Mon Jul 14, 2014 1:43 am Post subject: ‘MQCD’ was not declared in this scope |
|
|
Voyager
Joined: 23 Jun 2014 Posts: 90
|
Hi,
I have been testing the MQCB functionality using a local QueueManager up to now. So I never set any channel or host parameters within my code. However now when I try to add
Code: |
MQCD ClientConn = {MQCD_CLIENT_CONN_DEFAULT}; /* Client connection channel */ |
it gives me the following error.
Code: |
MQCallBackQueue.cpp:65: error: ‘MQCD’ was not declared in this scope
MQCallBackQueue.cpp:65: error: expected ‘;’ before ‘ClientConn’ |
my full code is as below.
Code: |
MQCNO cno = {MQCNO_DEFAULT};
cno.Options = MQCNO_HANDLE_SHARE_BLOCK ;
strcpy(QMgrName,QMgrName);
MQCONNX(QMgrName, &cno ,&Hcon, &CompCode, &CReason);
newConnObj = false;
// Open Queues
MQOD od = {MQOD_DEFAULT};
O_options = MQOO_INPUT_AS_Q_DEF|MQOO_FAIL_IF_QUIESCING;
MOD_EXIT:
strcpy(od.ObjectName, Qname.c_str());
MQOPEN(Hcon, &od, O_options, &Hobj, &OpenCode, &Reason);
if (OpenCode == MQCC_FAILED)
{
printf("MQOPEN of '%.48s' ended with reason code %d for connection handle 0\n",
od.ObjectName,Reason);
goto MOD_EXIT;
}
//Callback
MQMD md = {MQMD_DEFAULT};
MQGMO gmo = {MQGMO_DEFAULT};
MQCBD cbd = {MQCBD_DEFAULT};
cbd.CallbackFunction = (void*)MessageConsumer2;
cbd.CallbackArea = (void*)this;
gmo.Options = MQGMO_NO_SYNCPOINT;
MQCB(Hcon, MQOP_REGISTER, &cbd, Hobj, &md, &gmo, &CompCode, &Reason);
if (CompCode == MQCC_FAILED)
{
printf("MQCB ended with reason code %d for connection handle 0\n", Reason);
goto MOD_EXIT;
}
/////
MQCTLO ctlo = {MQCTLO_DEFAULT};
MQCTL(Hcon, MQOP_START, &ctlo, &CompCode, &Reason);
if (CompCode == MQCC_FAILED)
{
printf("MQCTL ended with reason code %d\n", Reason);
goto MOD_EXIT;
}
|
Please help me with this error. Thanks  |
|
Back to top |
|
 |
yasaboy |
Posted: Mon Jul 14, 2014 1:55 am Post subject: |
|
|
Voyager
Joined: 23 Jun 2014 Posts: 90
|
Really sorry.
Found the reason you really have to include
Code: |
#include <cmqxc.h> /* Channel defs */ |
together with
Code: |
#include <cmqc.h> /* includes for MQI */ |
and it works fine afterwords  |
|
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
|
|
|
|