Solved

Windows NT Service internal error

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE2 application frozen on Windows 10 10 270
delphi exception 7 61
Making delphi communicate with a c# service 16 88
Delphi 2 47
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…
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

919 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

17 Experts available now in Live!

Get 1:1 Help Now