Discussion Board

Results 1 to 3 of 3

Thread: Form troubles

  1. #1
    Registered User
    Join Date
    Mar 2003

    Unhappy Form troubles

    Hi folks.

    I'm having a frustrating time with a form at the moment. I'm using Carbide c/c++ 1.2 with s60 sdk 3rd edition fp1. I want a form in my application that records some info then does some stuff when the user presses 'Ok'.

    I'm using Carbide c++ and I used the form template (add new S60 UI design -> choose 'form'). It adds a view and a form to the project.

    In the autogenerated part of DoActivateL() of the view it creates the form, adds it to the control stack and displays it:

    	if ( iInfoForm == NULL )
    		CInfoForm* form = CInfoForm::NewL( this );
    		form->SetMopParent( this ); 
    		form->ExecuteLD( R_INFO_FORM_INFO_FORM );
    		AppUi()->AddToStackL( *this, form );
    		iInfoForm = form;
    The problem is I'm getting a Cone 44 panic when the user presses either 'ok' or 'back' in the form. According to the docs this panic is thrown by the destructor of the form - CCoeControl - when it detects that it is being destructed but it is still in someone's control stack.

    I don't want the app to exit when this form closes so in the ui designer I set 'exit application on close' to false.

    There's an option in the designed called 'modeless' which according to the help says that if it's set to true then the form will not be added to the control stack. Regardless of the setting here (true or false) the form is always added to the control stack.

    You know I'd refer to the form examples but I can't find any! I've looked in s60 3rd ed fp1 and s60 2nd ed and there's no mention of CAknForm in any of the examples. I've looked at the form article on the forum nokia wiki but it doesn't say anything about this particular problem.

    My (probably ignorant) opinion is that forms always destroy themselves and should never be added to a control stack. Am I correct here? Any suggestions folks?

    Oh and there's this cryptic carbide autogenerated comment in OkToExitL() of my form:

    	// The 'exit application on close' property automatically adds code to exit the 
    	// application when the right soft key is pressed. If this property is set to false, 
    	// and AddToStackL has been called on the Form object (e.g., it was not shown as a dialog), 
    	// code must be added manually to avoid a panic when exiting the application.
    I wonder does anyone know what this magical code is?
    Last edited by matdodgson; 2007-11-05 at 05:10.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Oslo, Norway

    Re: Form troubles

    You should never access an object, after you invoke an LD-method on it. Try without AddToStackL.

  3. #3
    Registered User
    Join Date
    Mar 2008

    Question Re: Form troubles


    I have the same question, see thread http://discussion.forum.nokia.com/fo...124#post513124

    The AddToStackL() is generated by the UiDesigner. And when you remove it you end up with the CONE 4 error.

    What is the answer to the code comment generated by the UiDesigner?
    Where do you add code to make the framework tick, and not generate the CONE44 error when switching back to the previous view.

    Nokia (or others) must have the answer to this. Please help me out on this one.



Similar Threads

  1. second form not getting key events
    By krsunil in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-12-10, 10:29
  2. problems in creating multipage form
    By A.Vogel in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-10-02, 08:16
  3. how to create a Form like Lockcode form?
    By sarvestan in forum Mobile Java General
    Replies: 2
    Last Post: 2006-08-29, 20:15
  4. How to pass variable between form
    By imagina23 in forum Mobile Java General
    Replies: 1
    Last Post: 2006-06-15, 18:29
  5. Form not displaying
    By Shabs in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-07-09, 16:38

Posting Permissions

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