Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I convert a Hex value stored in a charachter array to its ascii decimal value?

1 view
Skip to first unread message

Frankie

unread,
Mar 19, 2001, 2:16:51 PM3/19/01
to
Hi,
I need to allow a user input a hexadecimal value between 0 and FF. The user
inputs the value in an edit box. I can store this in a character array as a
string. However I need to validate that the value the user entered is
actually between 0 and FF. If I could convert the value e.g. AB to its ASCII
decimal value of 171 this would be relatively straight-forward. Is there a
standard function in C++ to do this similar to the atoi type functions?
Any help greatly appreciated,
Thanks.

Check Abdoul

unread,
Mar 19, 2001, 2:50:49 PM3/19/01
to
Hi Frankie...

You can use UlFromSzHex() function from mapi.lib.

Include mapiutil.h & link your app with mapi.lib

An Example:-

ULONG nInt = UlFromSzHex ( "ABC26" );

Cheers
Check Abdoul
------------------


"Frankie" <fra...@hotmail.com> wrote in message
news:oXst6.1475$_W2....@news.indigo.ie...

0 new messages