I have a C++ Windows service which starts a TCP server when booted. The problem is that when the user logs on/off the service no longer responses to client requests, also when returns from hibernation. So I need to get notified about the power modes so that I suspend/resume the server the proper way.
I tried ServiceBase.OnPowerEvent()
but visual studio says it is undefined. is this method available only for C#? is there a counterpart in C++?
It is worth mentioned that the service template I used have downloaded it from an online tutorial, not the default template that comes with VS.