Board index » cppbuilder » TService ?

TService ?


2003-10-06 03:21:55 PM
cppbuilder81
Hi,
I try to create my own NT service using TService component. I've written
OnExecute, OnStart, OnPause, OnContinue and OnStop event handlers. After it
is compiled, it can be installed
successfully. But When I've tried to start it, I've got following message:
"The MyService1 service on Local Computer started and stopped. Some services
stop automatically if they have no work to do, for example, the Performance
Logs and Alert Service."
This is my OnExecute event:
{
while(!Terminated)
ServiceThread->ProcessRequests(false);
}
In the OnStart new thread is created and TServerSocket activated.
Does anybody know what is wrong ?
TIA
noIdea
 
 

Re:TService ?

"noIdea" < XXXX@XXXXX.COM >wrote in message
Quote
This is my OnExecute event:
Get rid of the OnExecute event handler altogether. Because you are using a
separate worker thread created in the OnStart event, there is no need to use
OnExecute at all. The TService's default behavior when no OnExecute event
is assigned will be good enough to keep the service responsive correctly.
Gambit
 

Re:TService ?

Hello,
I create new project other... Service Application
and compile and run default items ,
when use command:
MyService.exe /INSTALL
got error code 1057
"The account name is invalid or does not exist, or the password is invalid
...."
can help me with an tutorial about write service application ?
regards,
m.t
 

{smallsort}

Re:TService ?

You have set a invalid ServiceStartName/Password for the service.
from help:
ServiceStartName is the name used to start the service.
If ServiceType is stWin32, ServiceStartName is the account name (in the form
"DomainName\Username") which the service process is logged on as when it
runs. If the account belongs to the built-in domain, ".\Username" can be
specified. If the service application includes more than one service, leave
ServiceStartName blank, and leave the Password property blank.
"Sasan" < XXXX@XXXXX.COM >wrote in message
Quote
Hello,
I create new project other... Service Application

and compile and run default items ,
when use command:
MyService.exe /INSTALL

got error code 1057
"The account name is invalid or does not exist, or the password is invalid
...."

can help me with an tutorial about write service application ?

regards,
m.t

 

Re:TService ?

"Sasan" < XXXX@XXXXX.COM >wrote in message
Quote
when use command:
MyService.exe /INSTALL

got error code 1057
"The account name is invalid or does not exist, or the password is invalid
What are your TService's properties set to? In particular, the ServiceType,
ServiceStartName and Password properties.
Gambit