Solved

Windows NT Service internal error

Posted on 2002-06-05
6
210 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now