Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Writing to the Windows NT System Log?

Posted on 2000-03-19
3
Medium Priority
?
218 Views
Last Modified: 2010-04-10
I need to write error messages to the system log. Can this be done? Is it difficult?
ciao.
0
Comment
Question by:salparadise
3 Comments
 
LVL 1

Expert Comment

by:wildy
ID: 2635203
Look for ReportEvent in the help system.

In fact it's not too difficult: you must first register a source (creating a key in the registry), then call ReportEvent.
0
 
LVL 1

Accepted Solution

by:
stewe earned 150 total points
ID: 2635407

Follow the instructions:

- Make a new Project: ATL COM Appwizard
- Server Type: Service

You can find a CServiceModule:LogEvent function that is waiting for reuse.

      Stewe
0
 

Expert Comment

by:wardkd
ID: 2635486
Writing to any of the event logs is fairly easy.
Somewhere in the initialisation of your program you need to register a file in the registry which contains your messages.
Then whenever you need to write to the log file, you call ReportEvent()
(I can provide a class in C++ if you need it.)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

963 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