Run in Background

Run in Background

Postby TimStone » Wed Aug 19, 2009 12:37 am

I did a search on running a FWH app in the background as a service, but only found reference to an article that explains a package that can run existing .exe's if you don't have access to the source code.

I intend to build an update routine that periodically checks a website and automatically downloads them when available, plus it will do other activities. It will run on a server and should be a "service" that is not viewed by the user. It would activate on startup, and remain running throughout the day.

Has anyone written this type of application with xHarbour / FWH, and if so, are there any guidelines / samples / docs ?

Thanks.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Run in Background

Postby driessen » Wed Aug 19, 2009 3:26 pm

Tim,

Maybe a very small help. I have a similar thing in my appliction.

In my application there is a calendar available. On every item of that calendar, an alarm can be set on.

Of course, these alarms have to be checked while my application is running and the users are doing other things.

So, when I start my application, a timer is started too. This timer has an interval of 1 minute. So every minute a background task is started which checks the alarms that have become active. If an alarm has become active, a dialog box is opened on top of all the other dialog boxes in which the user can decide what to do with the active alarm.

I use this already many years and it runs just fine.

Maybe you could solve your problem in the same way.

If any questions, don't hesitate to ask.

Good luck.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Run in Background

Postby TimStone » Wed Aug 19, 2009 5:03 pm

Thank you. Of course I will be using a timer. However, I need to create a program that runs in the background as a Window service on the primary ( server ) machine. It will interact with several offsite servers to transfer data ( FTP to and from those servers ) after defined intervals. It will automatically download updates to the program(s) and provide notifications. It will have no interaction with the user, only via the net, so it qualifies as a useable service. It would function similarly to most updating tools ( ie. Quickbooks ) provided with software packages.

I just thought maybe somebody had experience doing this with FWH/xHarbour.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Run in Background

Postby Antonio Linares » Wed Aug 19, 2009 6:06 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41403
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Run in Background

Postby TimStone » Wed Aug 19, 2009 9:21 pm

Thank you. I'll see if anyone posts other examples. That is certainly a good start.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Run in Background

Postby Otto » Sun Aug 23, 2009 2:37 pm

Hello Tim,
I found this post:

http://objectmix.com/xharbour/779023-windows-service.html

// A skeleton for writing a NT service for xHarbour compiler
// Author : Salvino Porto
// EMail : salvino.porto@gmail.com
// This file is derived from service.c by Craig Link - Microsoft Developer Support




Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6064
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Horizon and 50 guests