What could cause overriding WndProc and ProcessCmdKey ACCESS_VIOLATION error? - Forum - OpenEdge Development - Progress Community

What could cause overriding WndProc and ProcessCmdKey ACCESS_VIOLATION error?

 Forum

What could cause overriding WndProc and ProcessCmdKey ACCESS_VIOLATION error?

This question is answered

It seems like the mere act of overriding Form's preprocessing methods like WndProc and ProcessCmdKey in ABL Form can cause the application to throw ACCESS_VIOLATION error sporadically.

Any ideas?

Verified Answer
  • Joseph,
     
    This line -> RETURN SUPER:ProcessCmdKey(msg, keyData).
     
    Should be -> RETURN SUPER:ProcessCmdKey(INPUT-OUTPUT msg, keyData).
     
     
    Brian Maher
    Principal Engineer, Technical Support
    Progress
    Progress
    14 Oak Park | Bedford, MA 01730 | USA
    phone
    +1 781 280 3075
     
     
    Twitter
    Facebook
    LinkedIn
    Google+
     
     

All Replies
  • Hi Joseph,
     
    Do you have any protrace files?
     
    Brian Maher
    Principal Engineer, Technical Support
    Progress
    Progress
    14 Oak Park | Bedford, MA 01730 | USA
    phone
    +1 781 280 3075
     
     
    Twitter
    Facebook
    LinkedIn
    Google+
     
     

  • Try this. It's for the ProcessCmdKey.

    transfer.dmsi.com/.../protrace.17728

  • Looks like we called into a method of a .net object (static method) then a whole bunch of unknown stuff happened within the .net side then the .net side tried to call back into the ABL side.
     
    What does the code that handles the ProcessCmdKey look like?
     
    Brian Maher
    Principal Engineer, Technical Support
    Progress
    Progress
    14 Oak Park | Bedford, MA 01730 | USA
    phone
    +1 781 280 3075
     
     
    Twitter
    Facebook
    LinkedIn
    Google+
     
     

  • It's a form embedded inside a flyout pane (I've seen the error from just a standalone window too). No dialog-boxes or input-blocking code is called along the method (ItemLocator_TextBoxLeave) call stack.

    METHOD PROTECTED OVERRIDE LOGICAL ProcessCmdKey( INPUT-OUTPUT msg AS CLASS System.Windows.Forms.Message, INPUT keyData AS CLASS System.Windows.Forms.Keys ):

       glFromTab = Progress.Util.EnumHelper:AreEqual(keyData, System.Windows.Forms.Keys:Tab).

       IF glFromTab                            AND

          THIS-OBJECT:ByPassTabOnAutoLaunch    AND

          (gcOrigItem <> THIS-OBJECT:EditorText OR

          (gcOrigItem = "" AND THIS-OBJECT:EditorText = "")) THEN /* allow handling tabbing when the item is blank */

       DO:

         ItemLocator_TextBoxLeave( ?, ? ). /* parent container will be responsible for handling TAB destination */

         RETURN TRUE. /* processed */

       END.

       ELSE

         RETURN SUPER:ProcessCmdKey(msg, keyData).

    END METHOD.

  • Joseph,
     
    This line -> RETURN SUPER:ProcessCmdKey(msg, keyData).
     
    Should be -> RETURN SUPER:ProcessCmdKey(INPUT-OUTPUT msg, keyData).
     
     
    Brian Maher
    Principal Engineer, Technical Support
    Progress
    Progress
    14 Oak Park | Bedford, MA 01730 | USA
    phone
    +1 781 280 3075
     
     
    Twitter
    Facebook
    LinkedIn
    Google+
     
     

  • Joseph,

    Adding INPUT-OUTPUT to the parameter when you call the SUPER in WndProc is also needed (assuming that it isn't there).

    Brian

  • Thanks, I'll try that one.

  • I put in placed your suggested change, but today (after 3 months), we just hit another ACCESS-VIOLATION error.

  • Please open an official support case for this.
     
     
    Brian Maher
    Principal Engineer, Technical Support
    Progress
    Progress
    14 Oak Park | Bedford, MA 01730 | USA
    phone
    +1 781 280 3075
     
     
    Twitter
    Facebook
    LinkedIn
    Google+