A Service Monitor application

This forum is for general support of Xbase++
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

A Service Monitor application

#1 Post by rdonnay »

Brian Wolfsohn suggested that I write a Service Monitor application that is a small shell used to load another application.
This was done to try to get around the problems of not being interactive under Win3002 server.

The idea is that the small app would be loaded as a service and it would constantly monitor to see if the main app is running.
If it isn't then it starts it with RunShell(). The app to run is defined in SERVMON.INI.

I have a problem with this, because it appears that RunShell() won't allow me to call another Xbase++ program from an app that is running as a service.

I have attached the code.
Any ideas?
Attachments
servmon.zip
(2.73 KiB) Downloaded 884 times
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: A Service Monitor application

#2 Post by bwolfsohn »

rdonnay wrote:Brian Wolfsohn suggested that I write a Service Monitor application that is a small shell used to load another application.
This was done to try to get around the problems of not being interactive under Win3002 server.

The idea is that the small app would be loaded as a service and it would constantly monitor to see if the main app is running.
If it isn't then it starts it with RunShell(). The app to run is defined in SERVMON.INI.

I have a problem with this, because it appears that RunShell() won't allow me to call another Xbase++ program from an app that is running as a service.

I have attached the code.
Any ideas?
Roger,

You might want to send this out on the xbase list also.. There might be someone outside of express++ who's done this already.. Mabe even boris..

Brian
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

Pablo Botella
Posts: 8
Joined: Wed Feb 03, 2010 1:04 am

Re: A Service Monitor application

#3 Post by Pablo Botella »

Hi Roger,
Hector was point me out about this issue.

I don't have the source of DC_IsAppRunning() but I can imagine you are using the windows class and title with FindWindow() or FindWindowEx() to locate the main window of the program.

The trouble is that the service even loged-on with the same user/pwd is running in a diferent WindowsStation/Desktop and you windows are not visible through diferent desktops, however this is not a big trouble as you can check if a process is runing using the PsAPI functions.

The other issue is that RunShell() don't allow to specify the WindowsStation/Desktop so the new process will be run in a noninteractive WindowsStation.

Will be not so mutch complex to implement this monitor properly, however it will need to invest some working time, so if you need it just send me a private email and I will give you a quote for this task.

Regards,

Pablo Botella

Post Reply