title: Log to event viewer on Windows with C++
body: <p>I want to use log on my C++ application. However, I'd like to use Windows (10) event viewer, instead of text files. I found out some weird calls, that I don't even know what the parameters mean - <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363679(v=vs.85).aspx" rel="noreferrer">ReportEvent</a>, <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363672(v=vs.85).aspx" rel="noreferrer">OpenEventLog</a> and some other <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363654(v=vs.85).aspx" rel="noreferrer">Event Logging functions</a>. I also can't use managed code, due to some limitations on my app.</p>
  
  <p>I've also tried to use the code on this <a href="https://msdn.microsoft.com/en-us/library/2awhba7a.aspx?cs-save-lang=1&amp;cs-lang=cpp#code-snippet-2" rel="noreferrer">link</a>, but I get compilation errors (namespace 'System' undefined - it seems some include files are missing...).</p>
  
  <p>I found no sample code that works yet.</p>
  
  <p>I would appreciate a sample code, if possible - just a simple logging from a local application, built in non managed C++. Can someone help?</p>