kazaamjt / Win32_Service-CPP-Template

A header file and an example implementing windows services in a not-so-painful-way™
The Unlicense
6 stars 3 forks source link

Missing CreateEvent for workerPaused and workerContinued #1

Open dx05 opened 1 year ago

dx05 commented 1 year ago

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

kazaamjt commented 1 year ago

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 1 year ago

Hi, thank you for your reply and your valuable piece of code, I’ve already done so in my copy. Kind regards, dx05

Am 20.06.2023 um 18:25 schrieb Yaron Vanhulst @.***>:

You are correct.

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

— Reply to this email directly, view it on GitHub https://github.com/kazaamjt/Win32_Service-CPP-Template/issues/1#issuecomment-1599118991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJYBK33QCI65R3IR5WE67MDXMHFGLANCNFSM6AAAAAAZNLA6BI. You are receiving this because you authored the thread.

modz2014 commented 7 months ago

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

kazaamjt commented 7 months ago

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.

modz2014 commented 7 months ago

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

kazaamjt commented 7 months ago

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.

modz2014 commented 7 months ago

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

kazaamjt commented 7 months ago

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

modz2014 commented 7 months ago

no it wont work the service does not start at all

kazaamjt commented 7 months ago

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