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)))); }
Powered by: 博客园 Copyright © 2024 txf2004 Powered by .NET 8.0 on Kubernetes