I'm relatively new to Visual C++. I'm trying to build a module to consume log events generated by the IIS 7.0 server in order to be able to analyze these logs in real-time. I found a Microsoft article which provides code that accomplishes the real-time capture:
http://learn.iis.net/page.aspx/581/advanced-logging-for-iis-70---real-time-logging#module
After some work, I've gotten this code to compile into a DLL on my machine (64-bit Windows XP with Visual Studio .NET 2008). I'm curious about the double initiation (?) of the m_hEventLog 'event viewer'. I've reproduced the constructor and the line in the private section which both seem to create a handle to the event viewer.
The constructor:
MyGlobalModule()
{
m_hEventLog = RegisterEventSource( NULL, L"IISADMIN" );
}
private:
HANDLE m_hEventLog;
My question: Why does m_hEventLog need to be declared twice?
Thanks in advance,
-Eric