Symbian 字符打印
我正在尝试构建一个非常简单的概念证明,我可以编写一个 Web 服务并实际从 symbian 环境调用该服务。该服务是一个简单的 Hello 服务,它采用 const char* 形式的名称,并返回“hello”+ char* 形式的名称形式的问候语。我的问题是,如何将 char* 转换为 TPtrC16,以便我可以使用 console->Write 函数将响应打印到屏幕上?我知道我可以搜索 API 并弄清楚这一点,但对于基本的概念演示,我宁愿不花时间(不确定我是否会再次使用 Symbian)。
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果
const char*
字符串采用 US-ASCII,您可以使用TDes::Copy
将其包装在TPtrC8
中复制到 16 -bit 描述符:如果是其他编码,请查看 SDK 帮助中的 charconv API。
If the
const char*
string is in US-ASCII, you can useTDes::Copy
to copy it wrapped in aTPtrC8
to a 16-bit descriptor:If it is in some other encoding, have a look at the
charconv
API in the SDK help.