kazaamjt/Win32_Service-CPP-Template

Missing CreateEvent for workerPaused and workerContinued

dx05 opened this issue · 10 comments

dx05 commented

Missing CreateEvent() calls for the two events workerPaused and workerContinued. Or did I miss something???
Kind regards, dx05

You are correct.

They should be initialized in WindowsService::startup.
You can make an PR to fix it.
Or I will do it when I find some time.

dx05 commented

it might help if the actual code works properly but it does not at all

well it is completely unlicensed so feel free make a better version.
If not tell me what isn't working.
I've been using this for a long while, but in the end I didn't need the pause/continue functionality.

well there is no code for it to even start the service or stop the service either so example of saying writing a text file to user download folder ect would be a good example to get it started

I think you misunderstand what this code does.
It is a library that allows you to write your own Windows Services.
It is essentially an object oriented c++ wrapper around the windows API.
There is no code to start the service, because a windows api callback starts it.

See the example to learn how it works.
EG you should replace the sleep call in the example with your code, then set up the exe as described in the readme.

maybe if could actually provide a full example of it would be help and nice

That is a full example.
I don't know what more you expect.
You can just copy paste that code and it will work,

no it wont work the service does not start at all

well open a new issue and we can discus further there, this issue is unrelated to your issue.