IEventLogger Method: LogEvent

 MessageID As Double,
 [Arguments] As Variant


[in] Double MessageID
The message identifier for the message string in the resource DLL.

[in] Variant Arguments
The array of strings that are inserted or merged with the message string to display the final message. This parameter is optional.

After setting the event details, the client should call this method to log the event details to the Windows event log. The "MessageID" is the message identifier used to search for a string in the resource DLL and "Arguments" is a pointer to the array of strings that are inserted into the message. The message is retrieved from a resource DLL.


Dim EventLog As IeventLogger
'Get the interface. 'DirectScript.EventLogger.1'is the ProgId of 'the Event Logger component.
Set EventLog = CreateObject ("DirectScript.EventLogger.1")
'Call the RegisterCurrentEventSource method
EventLog.RegisterCurrentEventSource "TestLog", "\\MOON",TestMsgFile.DLL", True
'Call the LogEvent method
EventLog.LogEvent 100, "The user was created successfully"


See Also: