1. iliyan iliev
  2. PowerBuilder
  3. Thursday, 5 September 2019 08:04 AM UTC

It's possible to use timing object in app without window object ?!

App start schedule process and don't window and i use timer event to start process.

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 5 September 2019 15:11 PM UTC
  2. PowerBuilder
  3. # 1

Hi Iiyan;

  Yes & No ....

YES: The Timing object exists on its own and can interact with either visual or non-visual object classes

NO: A PB app cannot continue to run unless it has an open Window (unless its in a tight loop which in not efficient MS-Window resource wise - aka "poor design").

   So the key would be to have an open non-visible window that the timing object can interact with (or any of its controls or NVUO's that it instantiated).

HTH

Regards ... Chris

 

Comment
  1. iliyan iliev
  2. Monday, 9 September 2019 08:22 AM UTC
It's possible convert PB app with non-vislable window do windows service with sc.exe or NSSM ?!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 9 September 2019 14:44 PM UTC
Hi Iliyan;

Absolutely .. I have been doing this with NSSM for over a decade! ;-)

Regards ... Chris
  1. Helpful
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 5 September 2019 13:13 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

Your app will run if you open a window having Visible = FALSE.

You may opt to make the window visible while you debug.

There is limit on how many TIMING objects can run at the same time within a single Windows O/S process. As far as I recall it used to be 15 or 16 when I checked about 20 years ago.

If you want to run a PB app as a Windows service you should consider one of the Windows service options available in the market. I have used PBNIServ from TopWiz Programming. I know there are other tools as well.

HTH /Michael

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 5 September 2019 13:10 PM UTC
  2. PowerBuilder
  3. # 3

You could have your application with the timer running in the systemtray.

For example check these out:

http://www.topwizprogramming.com/freecode_icontray.html

There are other ways, like running your application as a service:

http://www.topwizprogramming.com/pbniserv.html

 

Maybe you can also just run your application with an invisible window, but then you'd have to find a way to end it properly.

HIH

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 5 September 2019 12:00 PM UTC
  2. PowerBuilder
  3. # 4

Hi Iliyan,

I'm not sure what you want to do.

The timing object should run without a window.

But your application will not run without a window. If there is no open window after your applications open event finished your application will be automatically closed.

HTH,

René

Comment
  1. Roland Smith
  2. Thursday, 5 September 2019 13:28 PM UTC
A PowerBuilder program does not require a window. At a previous employer I wrote several windowless apps that ran on schedule once per night.

The main one created text files which were manually imported into our accounting software the next day.
  1. Helpful
  1. mike S
  2. Thursday, 5 September 2019 13:30 PM UTC
to work without a window, the application open event would need to have a loop to keep it from closing.

i would also use sleep instead of timer since you want to release cpu cycles back to the OS.



do while true

sleep(60) //wake up every 60 seconds

of_runprocess()

loop



a window might be better since sleep would prevent your app from getting notifications to end until it wakes up



  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.
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.