Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User ld_road's Avatar
    Join Date
    Sep 2004
    Posts
    33
    I would like that my aplication select an GPRS IAP and establishes this connection.
    I have got an UId from CommDb and set the UId in bearer.iIapId,but the istatus always return KErrCouldNotConnect. Who can check my code and tell me why not create the connection?

    my code:
    CCommsDatabase* CommDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(CommDb);

    CApSelect* ApSelect = CApSelect::NewLC(*CommDb, KEApIspTypeAll ,EApBearerTypeAll ,KEApSortUidAscending);
    CApDataHandler* datHand=CApDataHandler::NewLC(*CommDb);
    CApAccessPointItem* apItem = CApAccessPointItem::NewLC();

    if (ApSelect->MoveToFirst())
    {
    do
    {
    TUint uid = ApSelect->Uid();
    datHand->AccessPointDataL(uid, *apItem);
    TBuf<128> aIAPName;
    apItem->ReadTextL(EApWapAccessPointName, aIAPName);

    TInt rec = aIAPName.Find(_L("MY GPRS"));
    if (rec !=KErrNotFound) {
    apItem->ReadUint(EApWapAccessPointID, aIap); //return aIap = 4
    break;
    }

    }
    while(ApSelect->MoveNext());
    }
    CleanupStack::PopAndDestroy(4);
    iPref.iRanking = 1;
    iPref.iDirection = ECommDbConnectionDirectionOutgoing;
    iPref.iDialogPref = ECommDbDialogPrefDoNotPrompt;
    CCommsDbConnectionPrefTableView::TCommDbIapBearer bearer;
    bearer.iBearerSet = ECommDbBearerGPRS;
    bearer.iIapId =aIap;//aIap=4;
    iPref.iBearer = bearer;
    iStatus = KRequestPending;
    iConnect->ConnectL(iPref, iStatus);
    SetActive();

    in RunL():
    the istatus return KErrCouldNotConnect

    But "MY GPRS" is the 4th of the iap list.I think the aIap is correct.why could not connect?


  2. #2
    Registered User ld_road's Avatar
    Join Date
    Sep 2004
    Posts
    33
    I need help!

  3. #3
    Regular Contributor alokkumarsingh's Avatar
    Join Date
    Mar 2004
    Location
    India
    Posts
    67
    Hi,
    This link will solve your problem.
    If you have any more issues...can write to me.

    http://discussion.forum.nokia.com/fo...threadid=55424

    Cheers
    Alok Kumar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved