[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1329
  • Last Modified:

OpenEventLog /RegisterEventSource

Hi Folks,

what's the difference between these two functions?
OpenEventLog()/RegisterEventSource() - they both require the same arguments, return the same info, seem to be used for the same purpose.

when should i use one and not the other?

thanks and regards,

Mike.

0
meverest
Asked:
meverest
1 Solution
 
jkrCommented:
>>when should i use one and not the other?

They both serve different purposes - 'RegisterEventSource()' is used when reporting an event:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/hh/winbase/eventlog_969g.asp

"After you have added a source name to the registry, use the RegisterEventSource function to get a handle to the Application event log. The following example obtains the handle and then adds an event to the log using the ReportEvent function."

Whereas 'OpenEventLog()' is used for reading the event log:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/hh/winbase/eventlog_2u93.asp
0
 
meverestAuthor Commented:
ok,

that seems sensible enough.  if only the devstudio online docs made it that clear! ;-)

thanks and regards.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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