×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Question Browser Control API Crashes?

    Hi All!
    I am using browser control API in my application.
    I am trying open the embedded link through it.

    my code is :

    CreateBrowserControlWithObserversL(TBrCtlDefs::ECapabilityDisplayScrollBar|
    TBrCtlDefs::ECapabilityClientResolveEmbeddedURL);
    _LIT(KUrl, "www.google.com");

    iBrCtlInterface->LoadUrlL( KUrl );

    When I execute it on emulator, it crashes with "feature not supported(-5)" and then "System error(-2)"

    The SDk I am using is "Symbian\9.1\S60_3rd_MR"

    The same crash I can see with the browser control example given in SDK too.

    Whats the problem experts??

    Plz guide. Its urgent.

    Thanks in Advance.

    Regards.

    Shilpa K
    Regards,
    Shilpa Kulkarni

  2. #2
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    295

    Re: Browser Control API Crashes?

    Well try to create the browser with:
    Code:
        iBrCtlCapabilities = TBrCtlDefs::ECapabilityDisplayScrollBar | TBrCtlDefs::ECapabilityLoadHttpFw;
        TRect rect(Position(), Size());
        iBrCtlInterface = CreateBrowserControlL(this,
                            rect,
                            iBrCtlCapabilities,
                            iCommandBase,
                            NULL,
                            NULL,
                            NULL,
                            NULL,
                            NULL);
    Then call LoadUrl, it works. Then start adding those observers, maybe the problem is in there.

  3. #3
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Browser Control API Variable Response

    Thanks simo.salminen for the reply.

    I tried the CreateBrowserControlL(--) with NULL observers as well as with all the observers needed.

    The snippet of the code :
    ==========================================================
    // in ConstructL()
    iCommandBase = TBrCtlDefs::ECommandIdBase;

    iMyAppLoadEventObserver = CMobiStoreNLoadEventObserver::New(this);
    iMyAppStateChangeObserver = CMobiStoreNStateChangeObserver::NewL(this);

    iBrCtlCapabilities = TBrCtlDefs::ECapabilityDisplayScrollBar | TBrCtlDefs::ECapabilityLoadHttpFw ;

    TRect rect(Position(), Size());

    iBrCtlInterface = CreateBrowserControlL( this,
    rect,
    iBrCtlCapabilities,
    iCommandBase,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL);

    iBrCtlInterface->AddLoadEventObserverL(iMyAppLoadEventObserver );
    iBrCtlInterface->AddStateChangeObserverL(iMyAppStateChangeObserver );

    // In the function I am calling

    _LIT(KUrl, "http://www.google.com");
    iBrCtlInterface->LoadUrlL(KUrl);
    ==========================================================
    I compiled it through comand line too.
    When I call the function for loading URL there r variations in the response of API

    1. It asks for access point n continues. But it display blank screen. After exit crashes with CONE36 or doenst respond to exit command.
    2. It doesnt ask for access point, does nothing, no crash too.
    3. If I say TBrCtlDefs::ECapabilityClientResolveEmbeddedURL it crashes with
    -5 n -2.

    I wanna open the uRL e.g http://www.google.com

    In the SDK example for browser, they have opened the existing .htms.

    I wanna open the live http link..

    What changes are to be done if necessary??

    Experts plz guide.. Its very urgent

    Thanks in Advance
    Regards,
    Shilpa Kulkarni

  4. #4
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    295

    Re: Browser Control API Crashes?

    Hmm, weird. Have you called SetRect(aRect); before calling CreateBrowserControlL? Is there proper ComponentControl() implementation? Anything funny in the Draw()? Try to make it display local pages first (LoadFileL), at least that should work.

    Btw, don't delete the instance of iBrCtlInterface during program execution, there is a known issue that browser component wont work after that.

    As a side note, the browser component is very unstable, as you have noticed. Luckily the source code for reference implementation of browser is available (see S60 webkit), so you can at least check how they have managed to get it working.

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    20

    Re: Browser Control API Crashes?

    You must call iBrCtlInterface->ActivateL() before calling LoadUrlL.

    Symbian is really tricky and hard! we have to guess about how the components work.

  6. #6
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: Browser Control API Crashes?

    hi!
    Thanks for the replies.
    I have solved the issue so many days back.
    I was using S60_3rd_MR SDK... it was giving such problems
    When I used S60_3rd it works fine.
    Couldnt get the reason but..??
    Regards,
    Shilpa Kulkarni

  7. #7
    Registered User
    Join Date
    Aug 2007
    Posts
    9

    Re: Browser Control API Crashes?

    //----------------------------------------------------------------
    // CBrCtlSampleAppContainer::ConstructL(const TRect& aRect)
    // EPOC two phased constructor
    // ---------------------------------------------------------
    //
    void CBrCtlSampleAppContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    SetRect(aRect);
    ActivateL();
    iCommandBase = TBrCtlDefs::ECommandIdBase;
    iBrCtlCapabilities = TBrCtlDefs::ECapabilityDisplayScrollBar |
    TBrCtlDefs::ECapabilityLoadHttpFw;
    TRect rect(Position(), Size());
    iBrCtlInterface = CreateBrowserControlL( this,rect,
    iBrCtlCapabilities,
    iCommandBase,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL);
    }

    The code above is from S60_Platform: S60_Platform_Browser_Control_API_Guide_v2_0_en.pdf

    If you run that code, Kern Panic 3 will occur. Because we call ActivateL() before we create child component, in this case is iBrCtlInterface. To fix the problem move the ActivateL() to the bottom of the code like this:

    void CBrCtlSampleAppContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    iCommandBase = TBrCtlDefs::ECommandIdBase;
    iBrCtlCapabilities = TBrCtlDefs::ECapabilityDisplayScrollBar |
    TBrCtlDefs::ECapabilityLoadHttpFw;
    TRect rect(Position(), Size());
    iBrCtlInterface = CreateBrowserControlL( this,rect,
    iBrCtlCapabilities,
    iCommandBase,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL);

    SetRect(aRect);
    ActivateL();
    }

    and don't forget implement these methods for compound control:
    TInt CountComponentControls() const;
    CCoeControl *ComponentControl(TInt aIndex) const;
    Last edited by kadriansyah; 2008-01-21 at 07:09. Reason: adding new explanation

Similar Threads

  1. PC Suite error: (Code: Init IMediaControl2) HELP?!
    By chunkyspudmonkey in forum General Development Questions
    Replies: 29
    Last Post: 2008-06-30, 11:47
  2. Browser Control API Crashes?
    By Shilpa13 in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-09-13, 08:10
  3. Problem when using Browser Control API
    By vinhcyim in forum Symbian
    Replies: 1
    Last Post: 2006-07-11, 09:23
  4. Please Help-- Browser Control API
    By jackylb in forum Symbian C++
    Replies: 0
    Last Post: 2005-09-29, 11:31
  5. Browser control API in feature pack 3
    By RAMANA_IIIT in forum Symbian C++
    Replies: 0
    Last Post: 2005-05-12, 09:45

Posting Permissions

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