Solved

Windows NT Service internal error

Posted on 2002-06-05
6
213 Views
Last Modified: 2010-04-04
Dear All,

I've written a Windows NT Service application using delphi 5. The service application purpose is to transfer files from one location to another location using http.

This application frequently (15 mins) checks the sql server database for new data, and if its there then creates a tab delimited text file from the new data and transfers that created text file to another remote location using http. So this is the basic functionality of the application.

The problem is while it is transferring files if user stops the NT service it gives some windows nt internal error. Subsequently it neither allows us to start/stop the application (though the status is shown as stopped in services applet in control panel).

If this happens I had to restart the server then I can restart the application. How can i stop the service without restarting the server itself. B-coz no one can afford to restard the live server.

The other problem is it is taking maximum cpu time, how can i reduce this.

Thanks in advance
Rammohan
0
Comment
Question by:splram
6 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 200 total points
ID: 7058919
Hi,
Set TService.AllowStop property to false before the transfer and reset it to true after that. This way your service wont let the user to stop it when it's not appropriate.

About your second question: Do you have Application.ProcessMessages somewhere in a loop?

Regards, Geo
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7059920
q:
how did you create that loop ?
can you give us some code ?
what are you using to transfer the file ?

s:
you could stop the file transfer in the OnStop event of the service

and as geobul suggested use Application.ProcessMessages in the OnExecute event loop
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9010464
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from geobul

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 9101967
Mindphaser --> been busy huh? ;)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Performance of SQL statement 37 128
Delphi...Split view - idea? 1 90
How to make Sign in, using Clientdataset? 1 28
firemonkey Android Listview Sort items 7 55
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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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