1. Yiannis Papadomichelakis
  2. PowerBuilder
  3. Thursday, 20 June 2019 08:21 AM UTC


PB app (and IDE) crashes when I attempt to close a window sheet on inside the open event, while running on a MDIDock frame. When it's a simple MDI frame, no problem occurs.

I am wondering if it's a bad practice to close windows inside open event. Online help clearly says that application will crash if the close() function is not the last statement but in my case the close() call IS the last.




Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 20 June 2019 20:10 PM UTC
  2. PowerBuilder
  3. # 1

I totally agree with Andreas => IF in the open event, you decide you need to close, I suggest you do like this:

if lb_haveToClose then
   // Avoid user ever sees the window flicker on screen
   this.Visible = false
   // Signal that window must cease and desist
   post Close(this)
end if

This is the safe way to abort opening a window. "Open" event is a signal that the process to open a window including instantiating PB objects in the PB VM and obtaining UI resources in Window O/S in a moment results in the window becoming visible.

In airplanes it is bad rep to jump the brakes when you are so far down the runway that runway stops before you airplane stops. Hence, you must commit to the take-off but signal that you will immediately return and land because "this plane ain't gonna fly this time around."

PowerBuilder's "Open" is that moment in time. Pure luck may avoid your crash if you stand on the brakes but for the health of your crew, your passengers - or here your app and your end-user => Play it safe, take off but start the emergency landing procedure immediately.

HTH /Michael

  1. Yiannis Papadomichelakis
  2. Friday, 21 June 2019 10:29 AM UTC
I understand what you say, but we are talking about a huge app, that started using PB4. I thought I could benefit from the docked window interface by just changing the way I open the windows, now we also have to modify all main windows!

I think that, according to PB help, this could be bug. What do you think?
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 20 June 2019 17:51 PM UTC
  2. PowerBuilder
  3. # 2

What I prefer to do instead of closing directly from open event ιs to post function close() and return... Don't know if this could resolve the issue you are facing.

Καλή τύχη.


  1. Yiannis Papadomichelakis
  2. Friday, 21 June 2019 10:25 AM UTC
Of course it does, this was the first thing I tried but it haves the side effect of screen flashing, before the window closes. So, I use the hide() function but the flashing still occurs on the menu toolbar.

According to pb help, this should be a bug, isn't it?
  1. Helpful
  1. Andreas Mykonios
  2. Friday, 21 June 2019 10:55 AM UTC
Try to use setredraw(false) to the window (I guess you will have to set that to your mdidock! or mdidockhelp! window)... Maybe this issue can be handled like that... When the close finishes you should se back setredraw to true.

It may not be so easy, but should do some difference. Cannot try it. Have not a working example here with dockable windows.

  1. Helpful
  1. Brad Mettee
  2. Friday, 21 June 2019 13:09 PM UTC
If your window is flashing, set it visible=false on its properties, then use "this.post show()" at the end of the window open (or ue_open) event.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 20 June 2019 16:14 PM UTC
  2. PowerBuilder
  3. # 3

Hi Ioannis;

   What O/S version and PB version & build are you using?

 Regards ... Chris

  1. Yiannis Papadomichelakis
  2. Friday, 21 June 2019 10:21 AM UTC
Hi Chris

This occurs on PB2019 (Build 2082) and PB12.6 (Build 4098).
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 21 June 2019 15:35 PM UTC
Yes, I would suspect that the behaviour (crash) in either releases as thus far, Appeon has just assimilated the PB12.6 code base line into PB2017 and then carried the Dockable window feature support "as is" from PB2017 to PB2019.

I am not having this issue in my frameworks (v12. or v2017 or v2019) but, I use a "Window Manager" to control the proper closing of any Sheet, Document or Tabbed window.

Please Open a Support Ticket and include a simple PB2019 Test Case app for Appeon to verify this issue.
  1. Helpful
  1. Yiannis Papadomichelakis
  2. Monday, 24 June 2019 07:51 AM UTC
I will Chris, thanks!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.