OnShutdown() method is NOT being called ?!

Hi all experts,

I am using VS Pro 2005 and Win XP Pro. I have developed a C++ Window Service to detect the shutdown event and perform some tasks before desktop shutdown.

I have followed the MSDN instruction and assigned CanShutdown to TRUE. However, I found that OnShutdown() method is not being called. Could anyone please help me

Many Thanks

The following sample codes are attached for your reference:

===============================

virtual void ABCWS::ABCWSWinService::OnShutdown() override
{
ServiceStatusLog->WriteEntry("ABC Shutdown");
}
void InitializeComponent(void)
{
..
this->CanShutdown = true;
..
}

===============================



Answer this question

OnShutdown() method is NOT being called ?!

  • OnShutdown() method is NOT being called ?!