hi thanks for ur nice post! ive developed a service like u but ihave a problem in pause the service!
my service work when i pause it and its get changed to pause but it dosnt sleep!
it mean the code in its service main continiue running!!!!
what can i do because this section run in operating system side!!!
I modified your code to integrate it into my application. Now, I've a DLL which fetches and displays status of all services. Every other service reports their correct current except this one; following was logged into the Event Manager...
The service has reported an invalid current state 0.
Event Type: Error
Event Source: Service Control Manager
Event Category: None
Event ID: 7016
The PServ3 service has reported an invalid current state 0.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Waiting for your reply.
It's exactly what I'm searching for.
But since I never built any project without using the Application Wizard, I don't know how to build this service.
Can anybody tell me more (which kind of project, can it be an MFC, etc....)
There might be dozens of other articles like this, but I had trouble finding one! Maybe I'm using search engine wrong, but even now that I know this article is here, this is the only thing I could find:
<i><b>System - Table of Contents</b>
[ more results like this ]
Find the lowest price for a variety of products: Featured Categories: CodeGuru Sites Interact Of Interest Article Sections Other Section C++ COM-based Technologies Controls Data Frameworks Graphics & Multimedia Internet & Networking Miscellaneous Visual Studio Windows Programming Windows & Dialogs internet.commerce
The code in this article works well in it's own MS Visual C++ 6 (new .NET version in the mail) but, when I paste the exact same code into my much bigger project (none of my code getting involved) the call to StartServiceCtrlDispatcher() never results in ServiceMain() getting called. I've fixed this kind of problem in the past by trashing my project and starting fresh in a new one, but what a pain. Any ideas?
As it turns out, I've experimented with a rather large number of sample Windows service programs (trying to see why I have the above problem.) This one is easily one of the best: simple yet the most complete I've found. I could use it as an example of the right way to write sample programs in general. With luck we'll see more like this one.
Hy CodeGuru! You are becoming the laughing stock of everyone that had something to do with CodeGuru not by publishing such an article but rather by allowing some "Neanderthals" to post improper comments.
No offense but there are a lot of GREEN programmers that might have read the article and found it useful. For all the others just one thing: Did someone put a gun to your head and MADE you read it?? Don't think so ... So it's simple: If you don't find it interesting then don't read it.
From experience I can say that I would rather look at the way someone implemented a known concept than look in MSDN. Sometimes you may even find some new simple ideas that would help, even if it's a ****o world app...
It is here that I first found topics about flicker free drawing (things I would never find in MSDN :) for that matter) and they were stated in a HW app.
So if anyone at CodeGuru has any dignity left then it should "moderate" this pathetic excuse for a "discussion list"
This just about does it.
At one time this was the prime-programming site and I came every day to read the articles. Yes, some were a little dull or simplistic but the fact is that people have gone to the time and trouble to produce them. No one is forcing anyone else to read the articles or appraise the submissions.
However, what I do object to is comments that are rude and profane for no other reason than that they can be. And I don't even blame the childish morons who are submitting these comments. I blame the web master for not taking responsibility to ensure that what goes up is, at the very least, sensible and polite criticism. It can still be harsh and pointed but the use of bad language and personal criticism is uncalled for and shows that the submitter has a) poor command of the language and b) cannot control their childish tantrums.
I'm off to Code Project where all the grown-ups live.