NetTalk Central
The Rest Of NetTalk => The Rest - Ask For Help => Topic started by: rupertvz on March 25, 2015, 01:14:46 PM
-
Hi Guys,
I added the SelfService template to one of my apps.
This application used to run with the "NT-service" template. It is a very small app, I am hiding the application window and it already has a text-file log feature built into it.
Launching MyService /iss
The service installs, but immediately gives a message that the services is not running;
The log file however shows the entries, and the application did what it was supposed to do.
Should it loop automatically? Or should I built in a loop?
(I had previously used NT-service which included a loop option)
* It seems to start, run the application, then ends .. hence the reason it says "service did not start"?
-
Hi Rupert,
If you run the program as an exe does it just run once and end? If so that's what it'll do when it runs as a service.
If you want it to stay alive and do something over and over then you need to code it to do that - presumably using a timer event on the window.
>> Should it loop automatically?
no
>> Or should I built in a loop?
if you want it to stay alive and perform some task, then yes, you program it to do that.
>> (I had previously used NT-service which included a loop option)
Sounds like NT-Service is a "wrapper" of sorts that altered the program behavior. SelfService doesn't do that - SS turns your program into a service, after that it does whatever it is you programmed the program to do.
cheers
Bruce
-
Thanks Bruce,
I am using a source procedure as a "main" procedure, thus no window structure, or procedural timer.
I have in the meantime used a loop procedure with the "sleep" function ... not sure if this is good practice? Sustainable?
Hiding or having no procedure windows worked better for me using NT-Service.
Does it make a difference in Self-Service whether I use / hide procedure-windows from display?
-
Hi Rupert,
I've not used sleep myself, but I suppose it's ok.
Personally I'd just make a window, put a timer on it, and then put my code in the timer.
It doesn't matter if you hide the window or not - either way the user is not going to see it.
I leave mine "not hidden" so when the program runs as an exe then you can see it.
cheers
Bruce