I am attempting to construct a very simple proof of concept that I can write a web service and actually call the service from a symbian environment. The service is a simple Hello service which takes a name in the form of a const char* and returns back a greeting of the form “hello ” + name in the form of a char*. My question is, how do I convert a char* to a TPtrC16 so that I can use the console->Write function to print out the response to screen? I know I could search through the API and figure this out, but for a basic conceptual demo I’d rather not spend the time (not sure that Symbian is something I will ever work with again).
Thanks!
If the
const char*string is in US-ASCII, you can useTDes::Copyto copy it wrapped in aTPtrC8to a 16-bit descriptor:If it is in some other encoding, have a look at the
charconvAPI in the SDK help.