这里有很多信息
要弹出对话框选择iap,可以这样做,在fp1上成功,mr上老是leave出错!
CApSettingsHandler* settingsHandler = CApSettingsHandler::NewLC( ETrue, EApSettingsSelListIsPopUp , EApSettingsSelMenuSelectNormal, KEApIspTypeAll, EApBearerTypeAll, KEApSortNameAscending); TUint32 originallyFocused(0);
TUint32 selectedIap;
settingsHandler->RunSettingsL(originallyFocused, selectedIap); CleanupStack::PopAndDestroy(settingsHandler);
|
没办法只能在模拟器上这么做
void CVideoPlayEngine::SetDefaultIap(TInt aIapType, TUint32 &aIapId)
{ TInt ret = KErrNone; TBuf<KCommsDbSvrMaxColumnNameLength> apnName; TBuf<10> defApn; TUint32 fakeIapId; aIapId = 0; if(aIapType == 0) defApn = _L("cmnet"); else if(aIapType == 1) defApn = _L("cmwap"); else if(aIapType == 2) defApn = _L("Winsock");
CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP); CleanupStack::PushL(commDb); CCommsDbTableView* commView =commDb->OpenTableLC(TPtrC(OUTGOING_GPRS)); if (commView->GotoFirstRecord() == KErrNone) { do { commView->ReadTextL((TPtrC)GPRS_APN, apnName); commView->ReadUintL(TPtrC(COMMDB_ID), fakeIapId); if (apnName.Find(defApn) >= 0) { CCommsDbTableView* pIAPView = commDb->OpenViewMatchingUintLC(TPtrC(IAP), TPtrC(IAP_SERVICE), fakeIapId); TInt nErr = pIAPView->GotoFirstRecord(); if(nErr == KErrNone) {
pIAPView->ReadUintL(TPtrC(COMMDB_ID), fakeIapId);
aIapId = fakeIapId;
CleanupStack::PopAndDestroy(); //pIAPView
break;
}
CleanupStack::PopAndDestroy(); //pIAPView
}
}while(commView->GotoNextRecord() == KErrNone);
}
CleanupStack::PopAndDestroy(2); }
|
阅读(941) | 评论(0) | 转发(0) |