Working with EventLog on Vista

  • Thread starter Thread starter Olegus
  • Start date Start date
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
 
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?
 
Back
Top