首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> Symbian >> 多媒体 >> 正文
创建Internet连接最好的方法
作者:hoolee    文章来源:Nokia论坛    更新时间:2005-11-21 14:23:43
开发伙伴平台: 60系列开发平台 1.0/2.0
设备, 软件版本:
大类: Symbian C++
子类: 网络
说明:
建立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);

相关文章:
创建不提示用户使用哪种方法连接或者选择哪个GPRS接入点的Internet连接
去掉网络连接选项的提示,并使用指定的连接
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号