×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    74

    newbie, having problems with query dialog

    Hi, this is my first attempt to write a resource-based dialog. I'm trying to pop up a text query dialog. I have this code:

    Code:
    bool CSemacodeContainer::ShowQueryWithHeadingLineL()
    {
      TBuf<1024> sometext;
      CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL(sometext, CAknQueryDialog::EConfirmationTone);
      TRAPD(err, bool result = dlg->ExecuteLD(R_SEMACODE_DATA_QUERY_WITH_HEADING));
      if (err != KErrNone)
      {
        User::Panic (_L("Helper"), 1);
      }  
      return result;
    }
    Here is my resource.rss file:

    Code:
    //-----------------------------------------------------------------------------
    //
    //  r_semacode_data_query_with_heading
    //
    //-----------------------------------------------------------------------------
    RESOURCE DIALOG r_semacode_data_query_with_heading
    {
      flags = EEikDialogFlagWait | EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | EEikDialogFlagCbaButtons | EEikDialogFlagNoShadow;
      buttons = R_AVKON_SOFTKEYS_DONE_CANCEL;
      items= {
        DLG_LINE {
          type = EAknCtPopupHeadingPane;
          id = EAknMessageQueryHeaderId;
          control = AVKON_HEADING {
            label = "Data entering:";
            bmpfile = AVKON_BMPFILE_NAME;
            bmpid = EMbmAvkonQgn_indi_checkbox_on;
            bmpmask = EMbmAvkonQgn_indi_checkbox_on_mask;
          };
        },
        DLG_LINE {
          type = EAknCtQuery;
          id = EGeneralQuery;
          control = AVKON_DATA_QUERY { 
            // Use this when you have a heading in data query
            layout = EStaticSizeDataLayout; 
            label = "Data query with heading looks nice!!!:";
            control = EDWIN {
              flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; 
              maxlength=80; 
              width=16; 
              lines=1; 
            };
          };
        }
      };
    }

    when I run it I get "System Error (-1)".

    simon

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143
    Hi

    You don't need to use TRAP inside leaving function. The -1 error is generated by your panic line.

    so remove the TRAP and you should then see the real error popping up.

    You could also copy the resource definition from query example, use it as a base and make test if it works after each change, so then you could pinpoint when the problem start efecting your query.

    yucca

Posting Permissions

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