Does anyone know how to convert a char string ie char Something[] to a byte string used for so many of the windows base services and again vise versa from byte back to char string.
Thanks for the help
Peter
Printable View
Does anyone know how to convert a char string ie char Something[] to a byte string used for so many of the windows base services and again vise versa from byte back to char string.
Thanks for the help
Peter
byte = char :)
What functions are you trying to use? Just pass a pointer to the buffer.
Sorry what i ment is i have a char array which is an unsigned char array which is needed by the CryptGetProvParam and this function outputs the keystores to this string and i wanted to put these straight into a list box but the list box won't take the BYTE string (unsigned char) and i think it wants just a standard char string so how can i convert them so i can put the key stores in the list box.
Cheers
Peter
This is the error i am getting when i try and pass a pointer to the BYTE string into the listbox.additem.
cannot convert parameter 1 from 'unsigned char *' to 'const char *'
Peter
listbox.additem ??? Are you using MFC?
Either way, the content of pbData is definitely unprintable, and is different depending on the value of dwParam. What are you using for that?
im using PP_ENUMCONTAINERS as the value of dwParam this should in theory return the names of the key containers into pbData.
Ok. The data returned is a single string, so you can just assign it straight. However, you need to keep calling CryptGetProvParam to retrieve all the provider names.
(Isn't MSDN a wonderful thing? :))