Solved

Testing Service Apps

Posted on 1998-10-28
2
296 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
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 100 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

786 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