?
Solved

Testing Service Apps

Posted on 1998-10-28
2
Medium Priority
?
302 Views
Last Modified: 2008-02-01
I can write a service app, and override DoStart in the Service object (Correct?).

But How do I test it?  When it runs, it should beep 4 times with a second's gap between them.  It seems to run for 4 seconds then bomb out, but no beeps...?

  TService1 = class(TService)
  protected
    procedure DoStart; override;
  public
    function GetServiceController: PServiceController; override;
    { Public declarations }
  end;


procedure TService1.DoStart;
var
  i: Integer;
begin
  inherited;
  for i:=1 to 4 do
    begin
      Beep;
      Sleep(1000);
    end;
end;
0
Comment
Question by:bcrotaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344858
brocatz,

If I were you I should look on this page for more information :

http://www.wilsonc.demon.co.uk/delphi.htm#NT Specific Components

Sorry, I can't help you more.

Zif.
0
 
LVL 4

Accepted Solution

by:
davidmwilliams earned 200 total points
ID: 1344859
 The easiest way to test a service app is to make another project (and you can manage both simultaneously using a project group in Delphi 4) that generates a normal executable, and has a form.
  Drop two buttons on the form, Start and Stop, and copy the body of your service code into the Start method handler.  If you do any special processing when your service terminates on request, put this in the Stop method handler.  Then, you can run your service like a normal app, and step through it properly, etc., as well as send messages to the screen.
  This worked great for me when I wrote a service to extract alarms from a SCADA package using OLE, and then fax and email messages to relevant people.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question