RegisterEventSource returns with Acces Denied error

  • Thread starter Thread starter chichi1000
  • Start date Start date
C

chichi1000

Hello out there. I'm trying to log an Event to the Event Service's log on
a remote server. I'm merely calling

handle = RegisterEventSource("myserver", "mysourcename").

This returns a NULL handle with an Access Denid error. BTW - at this
point I expect it to fall into the Application log with "mysourcename".

However, when I use the managed C++ EventLog as follows, it works fine!

EventLog* myLog = new EventLog("Application", "myserver");

myLog->Source = S"mysourcename";

myLog->WriteEntry(S"error msg.",EventLogEntryType::Error);


Does anyone know what I missed? I tried to add Authenticated Users to the
AppEvt.Evt file. And my Registry has "mysourcename" there.

I do not want to use managed C++ since I need this in my CServiceModule
class. Can anyone help?
 
Back
Top