Hello All,
please could you help on this?
1)I met some conversion problem when I wrote my program.
I defined three variables of type CString:
m_channel, m_mgr and m_queue.
I have a function which fill these variables from the
registry.
After filling these values I can check them and they are
correct:
m_mgr is : MQ_TEST
m_queue is : QUEUE
m_channel is: CHANNEL1/TCP/192.168.1.84(1895)
In my program I have also defined these variables:
ImqQueueManager mgr;
ImqQueue queue;
ImqChannel channel;
ImqMessage msg;
ImqString strToken,strParse,imq_mgr,imq_queue;
My problem is here:
I used these code to set the properties of my variables:
LPTSTR my_channel= new TCHAR[m_channel.GetLength()+1];
_tcscpy(my_channel,m_channel);
LPTSTR my_mgr =new TCHAR[m_mgr.GetLength()+1];
_tcscpy(my_mgr,m_mgr);
imq_mgr = ImqString((const char*)my_mgr);
LPTSTR my_queue =new TCHAR[m_queue.GetLength() +1];
_tcscpy(my_queue,m_queue);
imq_queue =ImqString((const char*)my_queue);
strParse = ImqString((const char*)my_channel);
mgr.setName(imq_mgr);
queue.setName(imq_queue);
channel.setHeartBeatInterval(1);
if (strParse.cutOut(strToken,'/'))
channel.setChannelName(strToken);
is this correct?
if not how can I change this?
when I run my service I got the error:
"connection failed with reason code :2058"
when using the same code in an user interface I can connect to the queue manager.
any help will be greatly appreciated .
thanks
please could you help on this?
1)I met some conversion problem when I wrote my program.
I defined three variables of type CString:
m_channel, m_mgr and m_queue.
I have a function which fill these variables from the
registry.
After filling these values I can check them and they are
correct:
m_mgr is : MQ_TEST
m_queue is : QUEUE
m_channel is: CHANNEL1/TCP/192.168.1.84(1895)
In my program I have also defined these variables:
ImqQueueManager mgr;
ImqQueue queue;
ImqChannel channel;
ImqMessage msg;
ImqString strToken,strParse,imq_mgr,imq_queue;
My problem is here:
I used these code to set the properties of my variables:
LPTSTR my_channel= new TCHAR[m_channel.GetLength()+1];
_tcscpy(my_channel,m_channel);
LPTSTR my_mgr =new TCHAR[m_mgr.GetLength()+1];
_tcscpy(my_mgr,m_mgr);
imq_mgr = ImqString((const char*)my_mgr);
LPTSTR my_queue =new TCHAR[m_queue.GetLength() +1];
_tcscpy(my_queue,m_queue);
imq_queue =ImqString((const char*)my_queue);
strParse = ImqString((const char*)my_channel);
mgr.setName(imq_mgr);
queue.setName(imq_queue);
channel.setHeartBeatInterval(1);
if (strParse.cutOut(strToken,'/'))
channel.setChannelName(strToken);
is this correct?
if not how can I change this?
when I run my service I got the error:
"connection failed with reason code :2058"
when using the same code in an user interface I can connect to the queue manager.
any help will be greatly appreciated .
thanks