×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    33

    question about connecting an IAP

    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
    Join Date
    Sep 2004
    Posts
    33

    somebody help me

    I need help!

  3. #3
    Regular Contributor
    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
  •  
×