×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    31

    RHTTPSession::OpenL how to capture Cancel

    Hello All,

    I have following problem.
    I'm using WebClientEngine.cpp from the SDK examples as my web engine.

    When I send request for the first time on this line

    iSession.OpenL()

    (iSession is RHTTPSession)

    IAP selection dialog pops up.
    Now, let's say user pressed Cancel button, and then the same dialog pops up again and again and again.

    I'm looking for way to capture this Cancel press event and nicely handle it.

    Here is relevant part of the code from the example SDK

    But leave happens only if there are no access points on the phone configured.
    It never happens if user press Cancel.

    Code:
    TRAPD( err, iSession.OpenL() );
        if( err != KErrNone ) {
            // Most common error; no access point configured, and session creation
            // leaves with KErrNotFound.
        	iObserver.ClientOpenSessionFailedL( *this, err );
            User::Leave( err );
        }

    Would appreciate any comments.

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: RHTTPSession::OpenL how to capture Cancel

    Quote Originally Posted by DmitryZayats View Post
    Hello All,

    I have following problem.
    I'm using WebClientEngine.cpp from the SDK examples as my web engine.

    When I send request for the first time on this line

    iSession.OpenL()

    (iSession is RHTTPSession)

    IAP selection dialog pops up.
    Now, let's say user pressed Cancel button, and then the same dialog pops up again and again and again.

    I'm looking for way to capture this Cancel press event and nicely handle it.

    Here is relevant part of the code from the example SDK

    But leave happens only if there are no access points on the phone configured.
    It never happens if user press Cancel.

    Code:
    TRAPD( err, iSession.OpenL() );
        if( err != KErrNone ) {
            // Most common error; no access point configured, and session creation
            // leaves with KErrNotFound.
        	iObserver.ClientOpenSessionFailedL( *this, err );
            User::Leave( err );
        }

    Would appreciate any comments.
    when iSession.OpenL(); IAP selection dialog not pops up. it pop up when iTransaction.SubmitL().

    so you best way is use RConnection, and Start RCoonection, if user cancel IAP selection dialog , you will get KErrCancel.

    or user selected, so you open the RConnection, then

    RStringPool pool = iSession.StringPool();
    connInfo.SetPropertyL ( pool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable() ),
    THTTPHdrVal iSocketServ() );

    connInfo.SetPropertyL ( pool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ),
    THTTPHdrVal iConnection );
    will use the rconnection submit request.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

Similar Threads

  1. How to cancel a http connection mid-way
    By capricious28 in forum Mobile Java General
    Replies: 0
    Last Post: 2007-08-10, 10:42
  2. Audio Capture
    By aztec30 in forum Mobile Java General
    Replies: 1
    Last Post: 2006-09-15, 02:16
  3. weird CANCEL button behaviour
    By securityfocus in forum Symbian
    Replies: 0
    Last Post: 2005-03-18, 14:24
  4. How to get the cancel event In wait Note dialog
    By Waldemar_Arndt in forum Symbian
    Replies: 1
    Last Post: 2004-01-10, 11:47
  5. capture cancel in menu pane
    By rsaenzespinosa in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-06-03, 15:36

Posting Permissions

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