Original Post
I've been using ReportEvent to log messages from my service into the event logs. I call RegisterEvent then I call ReportEvent. I follow it with a DeregisterEvent. I have a strange problem where it stops logging after a while. At 1st, I thought the event log was just full. But, I noticed other services still logging messages, and Windows did not warn me the log was full. I also thought maybe the func ran into a problem. However, the loop the call was nested inside was still running (I have the service do other things, thus I know the loop is still running). void CService::LogMsg(const TCHAR* psz, WORD msgType) { const TCHAR* rgsz[] = { psz }; HANDLE hes = RegisterEventSource(0, GetDisplayName()); if (hes) { ReportEvent(hes, msgType, 0, 0, 0, 1, 0, rgsz, 0); DeregisterEventSource(hes); } } Any suggestions? Thanks.