Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Testing Service Apps

Posted on 1998-10-28
2
Medium Priority
?
303 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

610 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