• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

Writing to the Windows NT System Log?

I need to write error messages to the system log. Can this be done? Is it difficult?
ciao.
0
salparadise
Asked:
salparadise
1 Solution
 
wildyCommented:
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
 
steweCommented:

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
 
wardkdCommented:
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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now