symbian http 联网时 不弹出接入点框

symbian 不弹出接入点:目前在五版的 5800xm 5235测试通过。记录一下

void CHttpEngine::SetupConnectionL() { if (iConnectionSetupDone) { // Connection setup is done User::Leave(KErrAlreadyExists); } if (IsActive()) { User::Leave(KErrInUse); } TCommDbConnPref iPref; TInt IAPId = 0; User::LeaveIfError(iSocketServ.Connect()); User::LeaveIfError(iConnection.Open(iSocketServ)); // open the IAP communications database CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP); CleanupStack::PushL(commDB); // initialize a view CCommsDbConnectionPrefTableView* commDBView = commDB->OpenConnectionPrefTableInRankOrderLC( ECommDbConnectionDirectionUnknown); // go to the first record User::LeaveIfError(commDBView->GotoFirstRecord()); // Declare a prefTableView Object. CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref; // read the connection preferences commDBView->ReadConnectionPreferenceL(pref); TUint32 iapID = pref.iBearer.iIapId; // pop and destroy the IAP View CleanupStack::PopAndDestroy(commDBView); // pop and destroy the database object CleanupStack::PopAndDestroy(commDB); // Now we have the iap Id. Use it to connect for the connection. // Create a connection preference variable. TCommDbConnPref connectPref; // setup preferences connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt); connectPref.SetDirection(ECommDbConnectionDirectionUnknown); connectPref.SetBearerSet(ECommDbBearerGPRS); //Sets the CommDb ID of the IAP to use for this connection connectPref.SetIapId(iapID); User::LeaveIfError(iConnection.Start(connectPref)); TRAPD(err, iSession.OpenL()); //set the sessions connection info RStringPool strPool = iSession.StringPool(); RHTTPConnectionInfo connInfo = iSession.ConnectionInfo(); //to use our socket server and connection connInfo.SetPropertyL(strPool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal(iSocketServ.Handle())); connInfo.SetPropertyL(strPool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal(REINTERPRET_CAST(TInt, &(iConnection)))); }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值