1. iliyan iliev
  2. PowerBuilder
  3. Thursday, 05 September 2019

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
0
Votes
Undo

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
It's possible convert PB app with non-vislable window do windows service with sc.exe or NSSM ?!
  1. iliyan iliev
  2. Monday, 9 September 2019
Hi Iliyan;

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

Regards ... Chris
  1. Chris Pollach @Appeon
  2. Monday, 9 September 2019
There are no comments made yet.
  1. Thursday, 5 September 2019
  2. PowerBuilder
  3. # 1
Michael Kramer Accepted Answer Pending Moderation
0
Votes
Undo

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.
  1. Thursday, 5 September 2019
  2. PowerBuilder
  3. # 2
Miguel Leeuwe Accepted Answer Pending Moderation
0
Votes
Undo

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.
  1. Thursday, 5 September 2019
  2. PowerBuilder
  3. # 3
René Ullrich Accepted Answer Pending Moderation
0
Votes
Undo

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
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. Roland Smith
  2. Thursday, 5 September 2019
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. mike S
  2. Thursday, 5 September 2019
There are no comments made yet.
  1. Thursday, 5 September 2019
  2. PowerBuilder
  3. # 4
  • Page :
  • 1


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