1. Troy Cowan
  2. PowerBuilder
  3. Monday, 4 November 2024 19:01 PM UTC

We have a Powerbuilder application, consisting of course of some number of PBLs that have some number of datawindows, that have some number of columns. At some point in the past somebody put together what I’m going to call a “utility tool”, which is just a window with some small number of supporting objects. The point to this “utility tool” is to

  • Get the list of PBLs in the application via FindFirstFileA and FindNextFileA
  • Iterate through each PBL to get its list of DataWindows and Controls via LibraryDirectoryEx
  • Iterate through the columns in each DataWindow and Control and save its configuration off.

The end result is a “Data Dictionary” that someone can use to determine the table and column in the back end, given the window and column in the application, or vice versa.

The intent for this “utility tool” was for a developer to right click on it’s window in the PowerBuilder IDE and select Run/Preview. The tool would then run for however long it took to iterate through everything. This could take 2 to 3 minutes or so.

This evidentially worked for a while (years), but lately when we try to do this, the entire IDE will just go away – i.e. crash, but without any error message or anything else. It would just cease to be running. This happens randomly during the 2 to 3 minutes for the tool to complete. Sometimes it’s right away, sometimes it is more than a minute into the run. We tried adding some code to act as a log file – based on the results of this we know that the “crash” isn’t happening at the same point in code. It’s kind of all over the place.

Is there any way to debug why the PowerBuilder IDE is “crashing” or shutting down during a Run/Preview of a window?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 4 November 2024 19:35 PM UTC
  2. PowerBuilder
  3. # 1

Hi Troy;

  Since it sounds like your utility is making low level Windows API calls (like FindFirstFileA), I suspect that it's this API layer that might be creating the stability problem. For example, the FindFirstFileA command is an ANSI command where the current MS-Windows & PB versions are Unicode based. Thus, commands like FindFirstFileA should now be using FindFirstFileW API instead.

  Note that the library list should really be acquired using the GetLibraryList() method instead.  FYI ...

https://docs.appeon.com/pb2022/powerscript_reference/getLibraryList_func.html

  Note that when Sub-Apps are called from the IDE (DLLs, OCXs, DB drivers, etc) and they do not use TRY..CATCH coding - if the sub-app crashes without catching (handling) the error, then the error is raised up to the "main task" ( aka the IDE ) this is the layer terminated by the O/S. So that might explain the IDE just disappearing as it gets penalized for the lower level execution error. Food for thought.  HTH 

Regards ... Chris 

Comment
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.