Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can not connect to Qmanager from a service application

Status
Not open for further replies.

bath

Technical User
Nov 16, 2004
11
BE
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top