×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2005
    Location
    Bangalore(INDIA)
    Posts
    25

    iConnection.Start(prefs) access denied

    Hi All,
    I am facing a problem related to Internet Access Point. I wish to avoid the set the internet access point manually. I am using the following code.


    RHTTPSession iSession;
    TCommDbConnPref prefs;
    RStringPool strP;
    RHTTPConnectionInfo connInfo;
    RConnection iConnection;
    TInt err;
    TInetAddr ServerAddr(KInetAddrMMRServer, KTcpPort);
    ss.Connect();
    prefs.SetIapId(1);
    prefs.SetDialogPreference(ECommDbDialogPrefPrompt);// DoNot

    iConnection.Stop();
    User::LeaveIfError(iConnection.Open(ss));
    User::LeaveIfError(iConnection.Start(prefs));
    strP = iSession.StringPool();
    connInfo = iSession.ConnectionInfo();
    connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable() ), THTTPHdrVal (ss.Handle()) );
    TInt connPtr = REINTERPRET_CAST(TInt, &iConnection);
    connInfo.SetPropertyL ( strP.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ), THTTPHdrVal (connPtr) );
    }


    err=iSocket.Open(ss, KAfInet, KSockStream, KUndefinedProtocol,iConnection);

    // Make a connection
    iChannelState=EChannelConnected;
    //TRequestStatus iStatus;
    iSocket.Connect(ServerAddr, iStatus);
    SetActive();



    but i am suffering with iConnection.Start(prefs) function. It is showing access denied error. I realy appreciate you if you can help me.


    Thank you Very much(in advance)

    Regards
    Rakesh Kumar Jaiswal

  2. #2
    Registered User
    Join Date
    Feb 2004
    Posts
    124
    Coms database ID's and IapIds are not the same !

    you have not set: iPref.SetDirection(ECommDbConnectionDirectionOutgoing); iPref.SetBearerSet(KCommDbBearerPSD );

    I am not sure if they are mandatory.

    -----------

    CCommsDatabase* db = CCommsDatabase::NewL();
    CleanupStack::PushL(db);
    CApUtils* apUtils = CApUtils::NewLC(*db);
    // Convert IAP id to CommsDb id
    aIap = apUtils->IapIdFromWapIdL(aSelectedIap);
    CleanupStack::PopAndDestroy(2);


    By the way the 1st coms database id need not be 1. (AFAIK)

    Try 1st querying the id from user. Then save it to a file when you know the connection is ok.

    It might be easier to try wirh Rsocket at 1st.

    Just random thought, hopefully they will help...
    Last edited by jkekoni; 2005-04-04 at 11:07.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×