×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jun 2008
    Location
    Poland
    Posts
    60

    hide window to select APN

    Hi,

    I don't want to see window to select APN during http connection.
    I've found some solution
    Code:
            TRAPD(
            err, CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);
            db->SetGlobalSettingL(TPtrC(ASK_USER_BEFORE_DIAL),(TInt)false);
            delete db;
            )
    but it doesn't work.
    I have N95 (S60, FP1)

    Any idea how to solve this?

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: hide window to select APN

    http://www.google.com/notebook/publi...O8IgoQlauTjKIi

    it code 2 and 3 show how hide iap select dialog and how use the rconnection in rhttpsession
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  3. #3
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: hide window to select APN

    qxiaoyuan, thanks for sharing. Second code snippet also described in Wiki by following link - How can I create an Internet connection without prompting a dialog?

  4. #4
    Registered User
    Join Date
    Jun 2008
    Location
    Poland
    Posts
    60

    Re: hide window to select APN

    Thanks for hint,

    my code:
    Code:
    RSocketServ socketServ;
    RConnection connection;
    User::LeaveIfError(socketServ.Connect());
    User::LeaveIfError(connection.Open(socketServ));
    TCommDbConnPref pref;
    pref.SetIapId(3); // IAP ID for connection to be used
    pref.SetDialogPreference( ECommDbDialogPrefDoNotPrompt );
    pref.SetDirection( ECommDbConnectionDirectionOutgoing );
    connection.Start(pref);
            
    RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo();
    RStringPool pool = iHttpSession.StringPool();
           connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketServ,
            RHTTPSession::GetTable()), THTTPHdrVal(socketServ.Handle()));      connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketConnection,  RHTTPSession::GetTable()), THTTPHdrVal(connection.SubSessionHandle()));
    iHttpTransaction = iHttpSession.OpenTransactionL(uri, *iTransObs, requestMethod);
    (...)
    iHttpTransaction.SubmitL();
    Then my function has been finished, my code is waiting for callback in httpeventhandler. I don't have any callback, no window to select APN, but panic kern-exec 3.
    This panic doesn't exists if I don't try hide APN window.
    I check it on emulator
    On device is no panic, application hangt. I wait for about 5-6min and nothing, I had to kill it manually. No callback. Any idea?

    PS iapid is correct, I use hint from http://www.newlc.com/en/topic-9372 to retrieve iapid.
    Last edited by badzio; 2009-02-19 at 09:18.

  5. #5
    Nokia Developer Champion
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: hide window to select APN

    you need keep socketServ & connection alive until the work finish, so move it in class as member field.

    and check connection.Start(pref) return code.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  6. #6
    Registered User
    Join Date
    Jun 2008
    Location
    Poland
    Posts
    60

    Re: hide window to select APN

    Yep, i did that but it wasn't enough.
    I missed
    TInt connPtr = REINTERPRET_CAST(TInt, &connection); connInfo.SetPropertyL(strP.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal(connPtr));

  7. #7
    Registered User
    Join Date
    Jun 2008
    Location
    Poland
    Posts
    60

    Re: hide window to select APN

    Hi again, I have new problem. On emulator everything works fine (no window to select apn, application uses this apn which I set, content is downloaded), on device MHTTPTransactionCallback::MHFRunL returns -18
    Any idea?

  8. #8
    Nokia Developer Champion
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: hide window to select APN

    const TInt KErrNotReady=(-18);

    so it seems you lose something, can you show your code again?
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

Similar Threads

  1. Replies: 35
    Last Post: 2009-04-11, 14:36
  2. RWindowGroup::SetOrdinalPosition(-1) can not hide window
    By goodtaste in forum Symbian User Interface
    Replies: 7
    Last Post: 2007-06-04, 06:05
  3. Hide Window Problem
    By jordanlangholz in forum Symbian C++
    Replies: 4
    Last Post: 2007-04-25, 13:57
  4. hide APN selection dialog?
    By dakoz in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2006-03-19, 16:02
  5. About window views
    By thodime_guru in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-06-17, 18:00

Posting Permissions

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