TEventLogger

Hello,

I want to make a log with errors during the execution of my app. I'm trying to write an event to the windows Event Viewer with a VCL form application with C++ Builder XE5.
I'm using Vcl.SvcMgr.TEventLogger class.
The code in the header file is :
TEventLogger *Event;
The code in the cpp file is :
1
2
Event=new TEventLogger("MySource"); 
Event->LogMessage("MyMessage");

But beside my message, in the error description in the Event Viewer there is a message : "The description for Event ID 0 from source MySource cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted." . How can I remove that description and write only the message that I want? Should I be using other C++ class? I couldn't find any documentation about this class. The idea of using Event Viewer is that when the application is running on an user with restricted rights he won't be able to write to files, meaning I can't just type into a ".txt" file. If anyone else has a different idea how to make a log with errors, please share! Also any information on how to do that with a Firemonkey application with be useful as well. :)

Greetings,
Zdravko
Okay, how can I create a 'Message Text File' and how do I use it in my project? There are only examples of what the file must contain.
There was a link to a sample on that page. Here it is: http://msdn.microsoft.com/en-us/library/windows/desktop/dd996907(v=vs.85).aspx

This link has a better generalized explanation: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363669(v=vs.85).aspx


Message files are similar to resource files and manifests if that helps you to visualize how they work.
Topic archived. No new replies allowed.