ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Hex string to MQBYTE24 correl ID?

Post new topic  Reply to topic
 Hex string to MQBYTE24 correl ID? « View previous topic :: View next topic » 
Author Message
cmkeller
PostPosted: Wed Jan 19, 2005 7:32 am    Post subject: Hex string to MQBYTE24 correl ID? Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

How in the world (in C/C++) can I take a character-string reoresentation of an MQ Message ID and put it on my message as the binary value for correlation ID? When the string starts with "41", I want to be able to put byte value \x41 (65 in decimal) in the first position of my correl ID. I tried atoi, that only works on decimals. I refuse to believe that the neither the C/C++ language , the Windows API, or the MQ API has nothing that will convert a hex string into its numeric value, leaving me to manually multiply my numbers by 16, and requiring me to manually translate A-F to 10-15.
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
Nigelg
PostPosted: Wed Jan 19, 2005 8:13 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Try strtol in C.
Quote:
long strtol (String, EndPointer, Base)
const char *String;
char **EndPointer;
int Base;
...
The strtol subroutine returns a long integer whose value is represented by the character string to which the String parameter points. The strtol subroutine scans the string up to the first character that is inconsistent with the Base parameter. Leading white-space characters are ignored, and an optional sign may precede the digits.
Back to top
View user's profile Send private message
cmkeller
PostPosted: Wed Jan 19, 2005 9:15 pm    Post subject: Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

Perfect! Thanks, Nigel.
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Hex string to MQBYTE24 correl ID?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.