关于字符串类型转换
本帖最后由 todaywlq 于 2012-03-20 13:47:32 编辑 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();
}
[最优解释]
Hi,
在网上搜索"描述符转换"能找到很多例子,例如:
http://blog.sina.com.cn/s/blog_63b4ee0d0100futp.html
Regards
Ziteng Chen