Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
End_Dialog in event crashes OI
We are experiencing crashes of Open Insight when we try to close a window in an event. We have this both with SRP Edit Table and Report Table.
We are trying to simulate a popup window with a normal window, because a popup window cannot not be as sophisticated as a normal window. So in one window, we open another window with Dialog_Box. Then in the OnItemDblClick event we read the values of that row, and close the window with End_Dialog(@Window, returnValue). This crashes Open Insight.
I tried using Sent_Event(@Window, 'CLOSE') instead, but this didn't help. We also tried Post_Event(@Window, 'CLOSE'). This doesn't crash Open Insight, but most of the time this event doesn't come through at all.
Does anybody else have this behavior? Any suggestions would be welcome. Thanks!
We are trying to simulate a popup window with a normal window, because a popup window cannot not be as sophisticated as a normal window. So in one window, we open another window with Dialog_Box. Then in the OnItemDblClick event we read the values of that row, and close the window with End_Dialog(@Window, returnValue). This crashes Open Insight.
I tried using Sent_Event(@Window, 'CLOSE') instead, but this didn't help. We also tried Post_Event(@Window, 'CLOSE'). This doesn't crash Open Insight, but most of the time this event doesn't come through at all.
Does anybody else have this behavior? Any suggestions would be welcome. Thanks!
Comments
Our guess is that the window is being killed before all events are processed or closed properly. But we have no idea how to further investigate this.
How are you qualifying the OLE event? Synchronous or asynchronous? It needs to be the latter since modal forms in OI interfere with the event queue.
Some time ago I developed a habit of a work around for dialog boxes for this very reason.
I place an invisible OI button on the form. The OI button has a click event that triggers the close.
When the OLE close button is clicked I send a post_event click to the OI button.
A post_event(@Window, "CLOSE") wasn't sufficient to prevent the crash but the button click which in turn called the close seemed to do it.
Now I use to qualify my events synchronously but I changed that to asynchronous in 2014. I'm pretty sure the problem persisted after that hence I never changed the work around. In fact I think the only reason I remember the work around half the time is because I create a window without the OI button, it crashes and I go "Oh that's right".
That said, I don't think it crashes every time so that's why I'm listening for further updates. The removal of the synchronicity may have alleviated the frequency but not completely resolved the issue?
I hope I'm wrong because I'd rather just place the OLE button on the form and be done with it.
I'm not sure whether the problem is completely solved now, or it just crashes after 20 times double clicking instead of 4. We did see that most Post_Events don't come through at all, so this wasn't really an option either. If the problem persists I will probably get back and report here.