关于字符串类型转换
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();
}