Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with TServiceApplication

Status
Not open for further replies.

wimvanherp

Programmer
Mar 3, 2001
149
BE
Hallo,

i want to program a service under win2K so i made a little test to see how it works. It is a simple service that just beeps every x msec. It works allright to make and install the service, but as soon as it runs, it is impossible to stop the service. I have to reboot the computer to make it stop.
I just made a ServiceApplication and changed the following code to make it run


void __fastcall TService1::ServiceExecute(TService *Sender)
{ Start();

}
//---------------------------------------------------------------------------


int TService1::Start()
{ unsigned int delay=2000;
for(;;)
{ Beep();
ServiceThread->ProcessRequests(false);
Sleep(delay);


}

} // Start



When i changed to :processRequests(true) it didn't work either.

As you can see this is a very basic program, so can anybody tell me how i have to do this properly so that i will be able to stop the service ?

thanks

Wim Vanherp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top