×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

can not connect to Qmanager from a service application

can not connect to Qmanager from a service application

can not connect to Qmanager from a service application

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close