2. PowerBuilder
  3. Friday, 16 September 2022 10:08 AM UTC

HI I am using PB 12.5 Classical I created a wait window (wait_w) and showing the progress bar and and some text window type is = main. From main_w I am writing a string to windows registry and set a listener in wait_w the code is as follows. But lot code processing was done in main_w so I think wait_w is became inactive 


For Loop

ls_message_string = "Message ...."
RegistrySet("HKEY_LOCAL_MACHINE\Software\BPP","commandline", RegString!, ls_message)
il_hwd = Handle(wait_w)
send (il_hwd, 1024, 1 , 1 ) ;







Event ID = pbm_custom01

RegistryGet("HKEY_LOCAL_MACHINE\Software\BPP","commandline", RegString!, ls_message)

st_message1.text = ls_message


Accepted Answer
PRASHANT NIRGUN Accepted Answer Pending Moderation
  1. Friday, 16 September 2022 19:46 PM UTC
  2. PowerBuilder
  3. # Permalink

My Bad I checked I was writing a empty value to registry RegistrySet() and RegistryGet() was not returning -1 in that case was sure mistake is from my site. Closing the ticket as resolved.

There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 16 September 2022 16:17 PM UTC
  2. PowerBuilder
  3. # 1

Hi Prashant;

  Did you ...

  1. Create the "wait" window as a POPUP or CHILD window type?
  2. Did you place a YIELD() command in the "Main" window's loop?

Regards ... Chris

There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 16 September 2022 14:30 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Prashant -

From what I can gather from your post, you are attempting to have multiple windows within the application performing work simultaneously, each showing some visual indication of change/progress in either their own window or in a "status" window.

Regardless of the number of windows an application opens, a PB app normally has only a single execution thread - and that one thread has to manage everything, user/GUI interactions, file operations, database interactions, operating system interactions, etc. When the app opens a new window, PB instantiates the window and activates it, which causes events and code to be handled and executed by the new window. The code that opened the window is effectively suspended.

PB can spawn non-visual execution threads via Shared Objects (even older versions such as PB 12.5) to perform computations, file I/O, database retrievals/updates, but there can only be one thread that manages and updates the GUI. Not surprisingly, multi-threading is an advanced topic for PB developers. Unfortunately, there is very little helpful or useful  tutorial information on this topic in the PB documentation.

I do not know what your overall goal is. But, if you want to learn more, I suggest you look in the PowerBuilder Tech Articles section of the Appeon Community.

Best regards, John


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.