×
Namespaces

Variants
Actions

创建Internet连接最好的方法

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
huwell 在 30 Jun 2007 创建
最后由 hamishwillee 在 15 Dec 2011 编辑
  • 开发伙伴平台:

60系列开发平台 1.0/2.0


  • 说明:

建立Internet连接的最好的方法是使用Internet Connection Initiator API. 其头文件为Intconninit.h,链接库为Intconninit.lib。 下面是如何使用的示例代码,如果没有默认连接(Preferred Connection), 实际上, 你可以创建一个活动对象(active object)来控制连接的初始化过程.

CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref1;
CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref2;
//--- First preference ----
pref1.iRanking = 1;
pref1.iDirection = ECommDbConnectionDirectionOutgoing;
pref1.iDialogPref = ECommDbDialogPrefDoNotPrompt;
CCommsDbConnectionPrefTableView::TCommDbIapBeare bearer1;
bearer1.iBearerSet = ECommDbBearerGPRS;
bearer1.iIapId = 0x01;
pref1.iBearer = bearer1;
//---Second preference ---
pref2.iRanking = 2;
pref2.iDirection = ECommDbConnectionDirectionOutgoing;
pref2.iDialogPref = ECommDbDialogPrefDoNotPrompt;
CCommsDbConnectionPrefTableView::TCommDbIapBearer bearer2;
bearer2.iBearerSet = ECommDbBearerCSD;
bearer2.iIapId = 0x04;
pref2.iBearer = bearer2;
//---Call Initiator---
TRequestStatus status(KRequestPending);
CIntConnectionInitiator* initConn = CIntConnectionInitiator::NewL();
CleanupStack::PushL(initConn);
initConn->ConnectL(pref1, pref2, status);
This page was last modified on 15 December 2011, at 10:07.
112 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×