×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    151

    MGFetch in handlecommandL problem?

    I tried to browse imaga files in the view::handlecommandL.
    case EMyLoad: // from menubar
    {
    TBool ret = MGFetch::RunL(FilesDesArray, EImageFile, ETrue, this);
    break;
    }
    FilesDesArray is a CDesCArrayFlat.
    But when I run it on the phone, I select this command, the MGFetch brower dialog appeared almost, and then it crashed with kern-exec 3.
    I have tested that it is the RunL code that caused this error.
    But if I move the MGFetch::RunL to DoActivateL, it run well.
    Btw, I use series60 3rd version.

  2. #2
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    151

    Re: MGFetch in handlecommandL problem?

    Does anyone know this?

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    23

    Re: MGFetch in handlecommandL problem?

    Did you create an istance of CDesCArrayFlat?

    Here's how I use MGFetch

    CDesCArrayFlat* skin_Files = new (ELeave) CDesCArrayFlat(2);
    MGFetch::RunL(*skin_Files, EImageFile , EFalse, NULL);
    if( skin_Files->Count() > 0)
    {
    UpdateBackgroundImg( (*skin_Files)[0]);
    }
    delete skin_Files;

    fab

  4. #4
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    151

    Re: MGFetch in handlecommandL problem?

    Thanks,
    I wrote them in the handlecommandl of view class. But when the app runs, if I select the command, the MGFetch appears, but do not have file data, then it crashed.

    When I wrote them in the Doactivate of view, it worked well.

  5. #5
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    151

    Re: MGFetch in handlecommandL problem?

    Could somebody answer me?

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    3

    Re: MGFetch in handlecommandL problem?

    Hi,

    I experienced also crashing in 3rd ed. phones when using MGFetch in HandleCommandL. To circumvent the issue, I put the call to MGFetch::RunL to an an asynchronous method instead of directly calling it in HandleCommandL(). This way it doesn't crash.

    Example:

    class CMyAppUi : public CAknAppUi {
    public:
    void HandleCommandL(TInt aCommand);
    static TInt MgFetchCB(TAny* aParam);
    ...
    private:
    CAsyncCallBack* iMgFetchAsync;
    TFileName iMediaFileName;
    };

    void CMyAppUi::HandleCommandL(TInt aCommand) {
    iMgFetchAsync = new (ELeave)CAsyncCallBack(TCallBack(MgFethCB,this), CActive::EPriorityStandard);
    iMgFetchAsync->CallBack();
    }

    void CMyAppUi::MgFetchCB(TAny* aParam) {
    CMyAppUi* self = (CMyAppUi*)(aParam);

    // Call MGFetch::RunL()
    CDesCArray* selectedFiles = new (ELeave)CDesCArrayFlat(10);
    CleanupStack::PushL(selectedFiles);

    if (MGFetch::RunL(*selectedFiles, EImageFile, EFalse, NULL)) {
    self->iFileName.Copy((*selectedFiles)[0]);
    // start an action with the iFileName
    }
    CleanupStack::PopAndDestroy(selectedFiles);
    }

  7. #7
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    151

    Re: MGFetch in handlecommandL problem?

    Thanks.
    I remember I solved this problem by just putting the MGFetch::RunL to a seperate function and I call the function in the HandleCommandL.

    This is strange, but it works. Considering the S60 3rd being an almost new platform, it is understandable.

Similar Threads

  1. J2ME: Problem in Nokia Solution for a software problem
    By mte01 in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2011-06-08, 05:52
  2. problem when stop playing video on 3650 and try to play again
    By niko86 in forum Mobile Java General
    Replies: 5
    Last Post: 2007-08-03, 07:40
  3. Ringing problem with Nokia N70
    By DVogdos in forum Audio
    Replies: 2
    Last Post: 2007-06-26, 20:49
  4. Replies: 1
    Last Post: 2005-12-04, 12:01
  5. J2ME: Problem in Nokia Solution for a media problem
    By mte01 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-08-12, 11:30

Posting Permissions

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