End_Dialog not releasing record lock when used on data-bound form (OpenInsight 32-Bit)
At 21 OCT 2010 02:53:58PM chip fichot wrote:
Hello -
OI v 8.0.8
We have a window which has given us intermittent issues in the past with the error "ENG0040: RUN_EVENT line 1. The labelled common variable has been freed and is no longer valid".
I believe that the issue stems from the fact that the window is being called using Dialog_Box but it is being closed through the regular event processing (i.e. no End_Dialog present).
While doing an update to the window, I wanted to address this.
This window may need to be invoked as an MDI Child or as a dialog box, depending on the context, so I am setting a variable (@CALLINGMODE) in the create event and setting the value to "DIALOG" if the window is invoked through the Dialog_Box function.
To correctly close the window using End_Dialog if invoked through that command, I re-worked the Close event with the following code:
CallingMode=Get_Property(@WINDOW,"@CALLINGMODE")
If CallingMode _eqc "DIALOG" then
Call End_Dialog(@WINDOW)Return 0End Else
Return 1End
This is closing the window properly, but it is not releasing the lock on the record if the window is invoked using Dialog_Box (however, it is behaving properly if the window is invoked using Start_MDIChild).
I have another window that I created from scratch using the same logic and I confirmed that it, too, is not releasing the lock when invoking END_DIALOG.
If anybody has any input, it would be greatly appreciated.
TIA,
Chip
At 21 OCT 2010 03:35PM cpates@sprezzatura.com wrote:
Chip,
How about sending a CLEAR event to the window before your end_dialog call?
The normal CLOSE event handles the unlocking but this doesn't get called in the case of end_Dialog - instead the dialog return value is updated and an internal End_Window() is called.
cpates@sprezzatura.com
Battlestar Sprezzatura - BSG 77
Colonial leaders in all things RevSoft
At 21 OCT 2010 04:03PM chip fichot wrote:
Thanks Carl - I think I was over-thinking this. That worked like a charm!