Question : Convert binary data to string to displayable text for user

Hey guys,
I am using this code to convert the encrypted data into string
CryptBinaryToString((BYTE *)pBufPtr,len,1,msg2,&lul_buflen);
The msg2 looks like
"KBeMW9yLvHwMow5dKCXO3ddKLzIGQTmbtNVmmFF2FmT9/f39q6urq6urq6vu/u7+"

and I am using the following functions to convert the string to long so that I can reduce the size to be displayed on the string
        char *p;
        long l = strtol(msg2, &p, 10);
        long temp1 = atoi(msg2);
But both of them return 0 as the value.
I need to take the string returned from CryptBinaryToString and convert it into text that can be displayed to the user so the user can type it or read it aloud so I need to reduce the size.

Please help.

vg

Answer : Convert binary data to string to displayable text for user

< Basically I need to take this huge string and make it short say into 10 characters or so to be displayed for the user and then expand it again into the original string in order to build the response at the other end.>

Not possible without losing information.
Random Solutions  
 
programming4us programming4us