Error when closing form
 
Forums / SmartComponent Library - Developer Forum / Error when closing form

Error when closing form

6 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    06 Sep
    Link to this post
    We are randomly seeing the following error since we upgraded to the 2024-06-30 release. 

    I have compiled all code numerous times, and I will still see this error. 

    Routine RecurseCheckIsOkToClose Consultingwerk.SmartComponents.Base.SmartWindowFormController sent called routine RaiseToolbarAction Consultingwerk.SmartComponents.Base.SmartWindowForm mismatched parameters. (2570)


    RecurseCheckIsOkToClose Consultingwerk.SmartComponents.Base.SmartWindowFormController at line 1806  (C:\ProgressWrk\OspreyVer128107\SmartComponentLibrary\Consultingwerk\SmartComponents\Base\SmartWindowFormController.r)
    FormClosingHandler Consultingwerk.SmartComponents.Base.SmartWindowFormController at line 1075  (C:\ProgressWrk\OspreyVer128107\SmartComponentLibrary\Consultingwerk\SmartComponents\Base\SmartWindowFormController.r)
    OnFormClosing Consultingwerk.SmartComponents.Base.SmartWindowForm at line 1459  (C:\ProgressWrk\OspreyVer128107\SmartComponentLibrary\Consultingwerk\SmartComponents\Base\SmartWindowForm.r)
    OnFormClosing MainMenu at line 1476  (C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\MainMenu.r)
    SetupApp.p at line 193  (C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\SetupApp.r)
    C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\OspreyHost.p at line 524  (C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\OspreyHost.r)
    adecomm/_runcode.p at line 678  (adecomm/_runcode.r)
    C:\Progress\OpenEdge\oeide\eclipse\plugins\com.openedge.pdt.debug.core_12.8.4.00\abl\_debuglauncher.p at line 109  (C:\Progress\OpenEdge\oeide\eclipse\plugins\com.openedge.pdt.debug.core_12.8.4.00\abl\_debuglauncher.p)

    Shown by:
    ShowErrorMessage Consultingwerk.Util.ErrorHelper at line 3128  (C:\ProgressWrk\OspreyVer128107\SmartComponentLibrary\Consultingwerk\Util\ErrorHelper.r)
    FormClosingHandler Consultingwerk.SmartComponents.Base.SmartWindowFormController at line 1122  (C:\ProgressWrk\OspreyVer128107\SmartComponentLibrary\Consultingwerk\SmartComponents\Base\SmartWindowFormController.r)
    OnFormClosing Consultingwerk.SmartComponents.Base.SmartWindowForm at line 1459  (C:\ProgressWrk\OspreyVer128107\SmartComponentLibrary\Consultingwerk\SmartComponents\Base\SmartWindowForm.r)
    OnFormClosing MainMenu at line 1476  (C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\MainMenu.r)
    SetupApp.p at line 193  (C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\SetupApp.r)
    C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\OspreyHost.p at line 524  (C:\ProgressWrk\OspreyVer128107\OspreyHost\client\host\OspreyHost.r)
    adecomm/_runcode.p at line 678  (adecomm/_runcode.r)
    C:\Progress\OpenEdge\oeide\eclipse\plugins\com.openedge.pdt.debug.core_12.8.4.00\abl\_debuglauncher.p at line 109  (C:\Progress\OpenEdge\oeide\eclipse\plugins\com.openedge.pdt.debug.core_12.8.4.00\abl\_debuglauncher.p)
  2. Mike Fechner
    Mike Fechner avatar
    342 posts
    Registered:
    14 Sep 2016
    06 Sep in reply to Roger Blanchard
    Link to this post
    Hi Roger, 

    how randomly is randomly? On random forms? Or on the same forms, at random times? 

    From which version have you updated? At first sight, there was not relevant change in the class files files relevant for this recently.  
  3. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    06 Sep in reply to Mike Fechner
    Link to this post
    It is always our Main Menu when closing but only for one of our projects.

    It is quite random but once it starts, the only solution is to delete all .r code and recompile all projects. Once I do that it no longer throws the error. Then, all of a sudden it starts again. 

    It is very odd. I did not see any recent bug fixes related to this which is why I was asking.

    I will try to figure out what is triggering it.
  4. Mike Fechner
    Mike Fechner avatar
    342 posts
    Registered:
    14 Sep 2016
    06 Sep in reply to Roger Blanchard
    Link to this post
    That sounds weird indeed.

    And it's even weirder. According to the stack-trace the error message

    Routine RecurseCheckIsOkToClose Consultingwerk.SmartComponents.Base.SmartWindowFormController sent called routine RaiseToolbarAction Consultingwerk.SmartComponents.Base.SmartWindowForm mismatched parameters. (2570)

    the method RecurseCheckIsOkToClose of the SmartWindowFormController should be calling RaiseToolbarAction in the SmartWindowForm

    Is is not - and has never.

        /**
         * Purpose: Recursively ask all Controls implementing the ICheckOkToClose Interface
         *          whether it is ok to close the form.
         * Notes:
         * @param poControls The System.Windows.Forms.Control+ControlCollection Collection of Controls to iterate
         * @param plShowMessage When TRUE a message is Shown explaining why it is not ok to close the parent form.
         * @param poCloseReason The System.Windows.Forms.CloseReason passed from then OnFormClosing Method of the parent form giving the reason who closes the form.
         * @return Logical value indicating if the Form can be closed or not.
         */
        METHOD PUBLIC LOGICAL RecurseCheckIsOkToClose (poControls    AS System.Windows.Forms.Control+ControlCollection,
                                                       plShowMessage AS LOGICAL,
                                                       poCloseReason AS System.Windows.Forms.CloseReason):


            IF poControls:Count > 0 THEN DO:


                {Consultingwerk/foreach.i Control oControl in poControls}
                    IF TYPE-OF (oControl, ICheckOkToClose) THEN DO:
                        IF NOT CAST (oControl, ICheckOkToClose):IsOkToClose (plShowMessage, poCloseReason) THEN
                            RETURN FALSE.
                    END.
                    ELSE
                        IF NOT THIS-OBJECT:Form:RecurseCheckIsOkToClose (oControl:Controls,
                                                                         plShowMessage,
                                                                         poCloseReason) THEN
                            RETURN FALSE.


                    CATCH err AS Progress.Lang.Error:
                        IF err:GetMessageNum (1) <> 15580 AND NOT err:GetMessage(1) MATCHES "* (15580)*":U THEN
                            UNDO, THROW err .
                    END CATCH.
                END.
            END.


            RETURN TRUE.


        END METHOD.

    I have checked the last 8 months since we're on the 12.8 maintenance branch.

    So when it's not in the source-code it indeed sounds like something's wrong in r-code. 

    Just to be on the safe side, can you please double check that the source code of the method matches what you have in your code-base?



  5. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    11 Sep in reply to Mike Fechner
    Link to this post
    The source code is correct. This is just plain weird. I will dig into it a bit further..thanks
  6. Mike Fechner
    Mike Fechner avatar
    342 posts
    Registered:
    14 Sep 2016
    11 Sep in reply to Roger Blanchard
    Link to this post
    Hi Roger, maybe Peter or I can have a look during PUG challenge as well.
6 posts, 0 answered