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

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   
 After filling these values I can check them and they are
     m_mgr is    : MQ_TEST
     m_queue is  : QUEUE   
     m_channel is: CHANNEL1/TCP/

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];
 LPTSTR my_mgr =new TCHAR[m_mgr.GetLength()+1];    
 imq_mgr = ImqString((const char*)my_mgr);

 LPTSTR my_queue =new TCHAR[m_queue.GetLength() +1];
 imq_queue =ImqString((const char*)my_queue);

 strParse = ImqString((const char*)my_channel);


 if (strParse.cutOut(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 .

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