Click here to Skip to main content
16,012,168 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionsearch files using recursive directory info Pin
jds120714-Jun-07 4:58
jds120714-Jun-07 4:58 
AnswerRe: search files using recursive directory info Pin
Kevin McFarlane14-Jun-07 9:05
Kevin McFarlane14-Jun-07 9:05 
QuestionFinding out if service is responsive QueryServiceStatus () Pin
berghain14-Jun-07 4:34
berghain14-Jun-07 4:34 
AnswerRe: Finding out if service is responsive QueryServiceStatus () Pin
Dave Kreskowiak14-Jun-07 6:19
mveDave Kreskowiak14-Jun-07 6:19 
GeneralRe: Finding out if service is responsive QueryServiceStatus () Pin
berghain14-Jun-07 22:08
berghain14-Jun-07 22:08 
GeneralRe: Finding out if service is responsive QueryServiceStatus () Pin
Dave Kreskowiak15-Jun-07 4:05
mveDave Kreskowiak15-Jun-07 4:05 
GeneralRe: Finding out if service is responsive QueryServiceStatus () Pin
berghain15-Jun-07 4:28
berghain15-Jun-07 4:28 
GeneralRe: Finding out if service is responsive QueryServiceStatus () Pin
Dave Kreskowiak15-Jun-07 8:13
mveDave Kreskowiak15-Jun-07 8:13 
If your service is based on the ServiceBase class, you don't. It's already registered when your service is launched. The ServiceBase class does not let you override any of it's members. You don't get the opportunity to replace it's functionality at all. Like I said, that stuff is maintained internally by the ServiceBase class.

You'd have to rewrite your service entirely on your own, supplying ALL the functionality that the ServiceBase class takes care of for you, but replacing the piece that registers the service control callback with your own function.

Google for ".NET Reflector" and download it. Open up the System.ServiceProcess.dll, then drill down to the ServiceBase class. This is what you'd have to rewrite. You'd mak your modifications to the Run method. Notice that most of the class is Private and not overridable. This is what's stopping you from replacing the piece you need.

The ServiceBase class is not only a wrapper for your service, but is also a buffer that insulates your service from the large amount of code between your service and the SCM.


Now, the problem is, this is all moot because you cannot replace the callback for the original service that you're trying to get a status for. It will STILL be registered and STILL return bogus status information.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionHow to read XML file and write it into Excel by using VB.Net 2.0 Pin
Be_Aman14-Jun-07 4:19
Be_Aman14-Jun-07 4:19 
AnswerRe: How to read XML file and write it into Excel by using VB.Net 2.0 Pin
Dave Kreskowiak14-Jun-07 6:08
mveDave Kreskowiak14-Jun-07 6:08 
QuestionManipulating ListBoxes in MS Access/VBA Pin
reegan4114-Jun-07 4:12
reegan4114-Jun-07 4:12 
AnswerRe: Manipulating ListBoxes in MS Access/VBA Pin
Dave Kreskowiak14-Jun-07 5:59
mveDave Kreskowiak14-Jun-07 5:59 
GeneralRe: Manipulating ListBoxes in MS Access/VBA Pin
reegan4114-Jun-07 6:05
reegan4114-Jun-07 6:05 
GeneralRe: Manipulating ListBoxes in MS Access/VBA Pin
Dave Kreskowiak14-Jun-07 6:13
mveDave Kreskowiak14-Jun-07 6:13 
GeneralRe: Manipulating ListBoxes in MS Access/VBA Pin
reegan4114-Jun-07 7:06
reegan4114-Jun-07 7:06 
GeneralRe: Manipulating ListBoxes in MS Access/VBA Pin
reegan4114-Jun-07 7:18
reegan4114-Jun-07 7:18 
GeneralRe: Manipulating ListBoxes in MS Access/VBA Pin
Dave Kreskowiak14-Jun-07 8:18
mveDave Kreskowiak14-Jun-07 8:18 
GeneralRe: Manipulating ListBoxes in MS Access/VBA Pin
reegan4114-Jun-07 9:05
reegan4114-Jun-07 9:05 
QuestionHow to ristrict a Windows form to Single instance Pin
pashitech14-Jun-07 4:04
pashitech14-Jun-07 4:04 
AnswerRe: How to ristrict a Windows form to Single instance Pin
Dave Kreskowiak14-Jun-07 5:52
mveDave Kreskowiak14-Jun-07 5:52 
QuestionDeveloping a Keylogger Pin
akatsa14-Jun-07 3:49
akatsa14-Jun-07 3:49 
AnswerRe: Developing a Keylogger Pin
Colin Angus Mackay14-Jun-07 4:52
Colin Angus Mackay14-Jun-07 4:52 
AnswerRe: Developing a Keylogger Pin
Dave Kreskowiak14-Jun-07 5:48
mveDave Kreskowiak14-Jun-07 5:48 
GeneralRe: Developing a Keylogger Pin
MatrixCoder14-Jun-07 9:24
MatrixCoder14-Jun-07 9:24 
GeneralRe: Developing a Keylogger Pin
Dave Kreskowiak14-Jun-07 9:42
mveDave Kreskowiak14-Jun-07 9:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.