Writing to NT Event Log

Posted on 1998-09-09
Last Modified: 2010-04-15
I have written a Win32 service in C and am interested in reporting events in the Event Log using the ReportEvent API. This only appends a substring to the main message.
How do I write the MAIN message using C functions
Question by:anandg090998
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1252556
What do you mean by MAIN message ?

ReportEvent(m_hEventSource, wType,       0,dwEventID,NULL, iNumberOfStrings,0,                  
                      pArrayOfStrings, NULL)

writes a perfect eventlog entry for me !


Expert Comment

ID: 1252557
Write Binary Data with:
ReportEvent(m_hEventSource, wType, 0,dwEventID,NULL, 0,iNumOfBytes,
                             NULL, (LPVOID) pBuffer)

Accepted Solution

xyu earned 100 total points
ID: 1252558
Get and unpack the file:

The "main" messages are defined in directory messages... it is  se workspace there for example of the compilation MC to BIN :) good luck

or go to
and download natlib library so You can use nwevlog.h/nwevlog.cpp (TWin32EventLog) to simplify event writing :)

Good Luck


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Where is my core dump file in Ubuntu? 12 460
Line meaning 9 89
Why isn't object file created? 6 87
nested if statement in excel help 4 40
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question