Re: Service App Problem
From: Anchorman (JesseN0SPAM_at_davinci-mims.com)
Date: 01/13/04
- Next message: ESPNSTI: "How do I use a TOleServer derived object properly? (Yet another interface question)."
- Previous message: Ed Dressel: "'Don't ask this again' check box in a MessageBox"
- In reply to: Guenther Wimpassinger: "Re: Service App Problem"
- Next in thread: Brett Watters: "Re: Service App Problem"
- Reply: Brett Watters: "Re: Service App Problem"
- Reply: Dmeister: "Re: Service App Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 13 Jan 2004 11:00:24 -0500
The application has a timer on it and every 3 minutes, it checks for an
e-mail at a certain e-mail address. If it finds one, it will download it,
log the information from it, generate a username and password, log that
information in a SQL database, and delete the e-mail. Really, the
application isn't that long. It uses Indy components for the e-mail stuff.
Here is my OnStart event:
procedure TCCCheckMail.ServiceStart(Sender: TService;
var Started: Boolean);
Var
oINI : TINIFile;
begin
Log2File('Service Started'); {This simply logs messages in a log file }
try
// get the timer and EMail File settings
oINI := TINIFile.Create('cc.ini');
{ Set it initially for 3 minutes }
Timer1.Interval :=
oINI.ReadInteger('Settings','TimerIntervals',180000);
EMFileLoc := oINI.ReadString('Settings','EMailFileLocation','D:\');
oINI.Free;
except
Log2File('Unable to open .INI File, defaults are in place.');
end;
end;
I've got a simple OnStop that simply puts "Service Stopped" into the log
file, and that's it, other than the standard OnExecute.
Jesse
"Guenther Wimpassinger" <gw_spam@pickem.at> wrote in message
news:40040da3$1@newsgroups.borland.com...
>
> "Anchorman" <JesseN0SPAM@davinci-mims.com> schrieb
>
> > I've got a service application that I wrote on a Win 2K Pro machine
using
> > Dephi 5. I can install the service, start it, and it runs just fine on
my
> > development machine. However, when I install it and try to start it on
> > either our Win 2K Server, or Win 2003 Server, I get the error, "Error
1053:
> > The service did not respond to the start or control request in a timely
> > fashion."
>
> Hm. What should your service-app do? Maybe you have an exception on the
> startup of the service and so the service is closed/terminated
automatically.
>
> Create a log-file where you store DebugInfo during the startup.
>
> HTH
> Guenther
>
>
>
>
- Next message: ESPNSTI: "How do I use a TOleServer derived object properly? (Yet another interface question)."
- Previous message: Ed Dressel: "'Don't ask this again' check box in a MessageBox"
- In reply to: Guenther Wimpassinger: "Re: Service App Problem"
- Next in thread: Brett Watters: "Re: Service App Problem"
- Reply: Brett Watters: "Re: Service App Problem"
- Reply: Dmeister: "Re: Service App Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|