Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows NT Service internal error

Posted on 2002-06-05
6
Medium Priority
?
217 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
[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
6 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 800 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

661 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