Chinaunix首页 | 论坛 | 博客
  • 博客访问: 326333
  • 博文数量: 88
  • 博客积分: 2051
  • 博客等级: 大尉
  • 技术积分: 950
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-14 23:59
文章分类

全部博文(88)

文章存档

2012年(3)

2011年(2)

2010年(9)

2009年(14)

2008年(60)

我的朋友

分类: C/C++

2008-11-18 20:19:41

这里有很多信息
 
要弹出对话框选择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) |
给主人留下些什么吧!~~