The return value is zero because there was a failure. Use GetLastError to get the error number, then look that up here[^]. This is the System Error Codes list on MSDN. You might want to check the value returned by RegisterEventSource first. It looks like your not getting a good EventLog handle returned here. Your passing in an empty string instead of a 0 (which means NULL). This is where I think your problem is. If you change the call to this, it might work:
hEventLog = RegisterEventSource("." & chr$(0), sSource)
Again, if you get back a zero for either RegisterEventSource or ReportEvent, then use GetLastError to find out what the error was. RageInTheMachine9532