×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Suzhou, China
    Posts
    107

    Odd behavior in CAknQueryDialog

    Hi

    I read somewhere (can't recall where) that the result of ExecuteLD is supposed to be whether the user selected yes or no, so I used this in my app and it worked, but... it only works on some phones, not others.

    My code looks like this:

    Code:
    			CAknQueryDialog* dlg = CAknQueryDialog::NewL();
    			if (dlg->ExecuteLD(R_WARNING, warning))
    On some phones it returns true if Yes is selected, but on others it returns false. My question - what is the correct way of checking the result?

    In the SDK documentation (for 3rd Edition) I see that ExecuteLD returns a TInt, but they do not mention what it contains, so I believe I am misinformed, otherwise it would be documented.

    Regards

    Lionel

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Odd behavior in CAknQueryDialog

    Check in SDK help CEikDialog::ExecuteLD():
    Returns:
    Zero, unless it is a waiting dialog. For a waiting dialog, the return value is the ID of the button that closed the dialog, or zero if it was the cancel button (EEikBidCancel).

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Odd behavior in CAknQueryDialog

    Yes, returned value will be depend on value of button set in resource file. for example if you set button as R_AVKON_SOFTKEYS_YES_NO then it return EAknSoftkeyYes, if you set R_AVKON_SOFTKEYS_OK_EMPTY then it return EAknSoftkeyOk.

  4. #4
    Regular Contributor
    Join Date
    Dec 2008
    Location
    Suzhou, China
    Posts
    107

    Re: Odd behavior in CAknQueryDialog

    Yes, I think I might have gotten confused somewhere as I used an Ok/Cancel before and this is a Yes/No.

    I've changed it to:

    Code:
    if (dlg->ExecuteLD(R_WARNING, warning) == EAknSoftkeyYes)
    Will see what happens like that. Just strange that the condition is never executed considering that the values of both Yes and No are non-zero, if I assume correctly, it would always evaluate to true, not false.

    Does this resource look ok for it? Or might I be doing something wrong there as well?

    Code:
    RESOURCE DIALOG r_warning
        {
        flags = EGeneralQueryFlags;
        buttons = R_AVKON_SOFTKEYS_YES_NO;
        items =
            {
            DLG_LINE
                {
                type = EAknCtQuery;
                id = EGeneralQuery;
                control = AVKON_CONFIRMATION_QUERY
                    {
                    layout = EConfirmationQueryLayout;
                    animation = R_QGN_NOTE_INFO_ANIM;   
                    };
                }
            };
        }
    Quote Originally Posted by savaj View Post
    Yes, returned value will be depend on value of button set in resource file. for example if you set button as R_AVKON_SOFTKEYS_YES_NO then it return EAknSoftkeyYes, if you set R_AVKON_SOFTKEYS_OK_EMPTY then it return EAknSoftkeyOk.

Similar Threads

  1. Maximum Text Limit for CAknQueryDialog
    By jinuthomas in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-09-16, 06:47
  2. Logging during ODD
    By santhosh1980 in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2008-01-11, 13:25
  3. Getting odd Exception in Eclipse
    By bigbrueder in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2007-10-18, 09:29
  4. Odd "needs to boot" problem 3rd
    By big_pig in forum Symbian
    Replies: 0
    Last Post: 2007-02-15, 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
  •  
×