Solved

Writing to the Windows NT System Log?

Posted on 2000-03-19
3
212 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
[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
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 50 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

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
Create string splitting user defined function in C++ 23 356
mixing C++ & C# in Vis Studio 2013 7 281
Exception thrown at 0x00007FFD5BC81F28 7 62
Need some help with design 17 48
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

751 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