Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Writing to NT Event Log

Posted on 1998-09-09
3
Medium Priority
?
255 Views
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
0
Comment
Question by:anandg090998
[X]
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
3 Comments
 
LVL 1

Expert Comment

by:jkrautner
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 !


0
 
LVL 1

Expert Comment

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

Accepted Solution

by:
xyu earned 200 total points
ID: 1252558
Get and unpack the file:
http://www.geocities.com/SiliconValley/1741/miscprog/logging.zip

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

or go to http://www.geocities.com/SiliconValley/1741
and download natlib library so You can use nwevlog.h/nwevlog.cpp (TWin32EventLog) to simplify event writing :)

Good Luck

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

715 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