关于字符串类型转换

todaywlq 2012-03-20 01:43:04
void CZXingBarcodeReaderAppView::ShowResultL(TDesC16& message)
{

CAknMessageQueryDialog* dlg = new (ELeave) CAknMessageQueryDialog();

dlg->PrepareLC(R_TEXT_QUERY_DIALOG);
_LIT8(TEST1,"扫描结果");//
TBufC8<22> str8(TEST1);
TBuf<50> str16;
CnvUtfConverter::ConvertToUnicodeFromUtf8(str16, str8);//utf8תunicode
dlg->QueryHeading()->SetTextL(str16);

//webservice
iService = new MyServiceSoap();
char* msg;
if (iService)
{
_ns1__GetCzxxResponse resp;
_ns1__GetCzxx gc;
gc.clientname = "symbian";
gc.qrCode = message; //此处需要传入message,但gc.qrCode 是 char* 这里要如何转换

if (iService->__ns2__GetCzxx(&gc, &resp) == SOAP_OK)
{
msg = resp.GetCzxxResult;
}
else
{
msg = "网络连接错误";
}
}
else
{
msg = "网络连接错误";
}


dlg->SetMessageTextL(msg); //此处需要显示msg,又要如何转换
dlg->RunLD();

CleanupStack::PopAndDestroy();

StartTimer();
}
...全文
262 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenziteng 2012-03-31
  • 打赏
  • 举报
回复
Hi,

在网上搜索"描述符转换"能找到很多例子,例如:

http://blog.sina.com.cn/s/blog_63b4ee0d0100futp.html

Regards

Ziteng Chen

3,120

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧