Solved

Writing to the Windows NT System Log?

Posted on 2000-03-19
3
204 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 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 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++.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now