×
Namespaces

Variants
Actions

创建Internet连接最棒的方法

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

文章
User:Jiangbaolan 在 02 Apr 2009 创建
最后由 hamishwillee 在 15 Dec 2011 编辑

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

Code: 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 09:35.
36 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.

×