Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor wudilp's Avatar
    Join Date
    Jul 2003
    Posts
    66
    difference between active obj and active function?

    who knows difference between
    user::waitForRequest(iStatus)
    and
    SetActive()+ RunL(),thank you very much!

    , i need a wait dialog in async function, but when i use the former, i can not see wait dialog. my code is following:
    if(iWaitDialog)
    {
    iWaitDialog->ProcessFinishedL();
    delete iWaitDialog;
    iWaitDialog=NULL;
    }
    iWaitDialog =
    new (ELeave) CAknWaitDialog(NULL, ETrue);
    iWaitDialog->SetCallback(this);
    iWaitDialog->ExecuteLD(R_BTMAN_WAIT_NOTE_SOFTKEY_CANCEL);
    User::WaitForRequest(iStatus);
    if(iStatus.Int()==KErrNone)
    {
    TPtr buf = iInfoBuf->Des();
    TPtrC deviceName;
    deviceName.Set(iRemoteDeviceName().iName);
    iReporter.PrintItem(deviceName,_L("0x0000"));
    TBTSockAddr BTSockAddr(iRemoteDeviceName().iAddr);
    iReporter.PrintBTInfo(BTSockAddr.BTAddr());
    }
    else
    {
    iReporter.PrintLine(_L("sorry,i can not find any btdevice!"));
    iHr.Close();//wudilp040319-s
    iWaitDialog->ProcessFinishedL(); //wudilp040319-e
    }

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,667
    The user::waitForRequest(iStatus) will wait there and block other AO's to run and SetActive()+ RunL(), will let other to do their tasks as well.

    So in case you want to use the wait dialog you should use SetActive()+ RunL(), so your dialog can have time to re-fresh when the function is executing.

    yucca

  3. #3
    Regular Contributor wudilp's Avatar
    Join Date
    Jul 2003
    Posts
    66
    it's very nice of you! with your help, i can run my code correctly, but i do not know how to cancel my waitdialog when it is running!

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,667
    you'll get you waitdialog callback function called when the user presses the cancel button.

    Then there you just need to cancel the asyncronous function, so basically you'll need to check the documentation for the object and find out how to cancel the operation that you are currently running.

    yucca

  5. #5
    Regular Contributor wudilp's Avatar
    Join Date
    Jul 2003
    Posts
    66
    sorry, maybe the mail reply system do not work, i do not see your reply, it's a very timely reply!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved