Working with EventLog on Vista

O

Olegus

My Windows application if running on Vista crashed on the next
statements( with ----> in the front):
if (!EventLog.SourceExists(Event.EventLogSource))
EventLog.CreateEventSource(Event.EventLogSource,
Event.EventLogLog);

myLog = new EventLog(Event.EventLogLog,
Environment.MachineName, Event.EventLogSource);
-----> //myLog.MaximumKilobytes = 4096;
-----> //
myLog.ModifyOverflowPolicy(OverflowAction.OverwriteAsNeeded, 0);

myLog.EntryWritten += new
EntryWrittenEventHandler(OnEntryWritten);
It works fine on XP. Any recommendations how to make it work on
Vista?

Thanks,
Olegus
 
G

GlennDoten

Olegus said:
My Windows application if running on Vista crashed on the next
statements( with ----> in the front):
if (!EventLog.SourceExists(Event.EventLogSource))
EventLog.CreateEventSource(Event.EventLogSource,
Event.EventLogLog);

myLog = new EventLog(Event.EventLogLog,
Environment.MachineName, Event.EventLogSource);
-----> //myLog.MaximumKilobytes = 4096;
-----> //
myLog.ModifyOverflowPolicy(OverflowAction.OverwriteAsNeeded, 0);

myLog.EntryWritten += new
EntryWrittenEventHandler(OnEntryWritten);
It works fine on XP. Any recommendations how to make it work on
Vista?

Thanks,
Olegus

"Crashed" how?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top