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

x
?
Solved

Writing to the Windows NT System Log?

Posted on 2000-03-19
3
Medium Priority
?
216 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 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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 shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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.
Suggested Courses

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