A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



RegisterEventSource

The RegisterEventSource function retrieves a registered handle to an event log.

VB4-32,5,6
Declare Function RegisterEventSource Lib "advapi32" Alias "RegisterEventSourceA" (ByVal lpUNCServerName As String, ByVal lpSourceName As String) As Long

Operating Systems Supported
Requires Windows NT 3.1 or later; Win9x/ME: Not supported

Library
Advapi32

Parameter Information
- lpUNCServerName
[in] Pointer to a null-terminated string that specifies the Universal Naming Convention (UNC) name of the server on which this operation is to be performed. If this parameter is NULL, the operation is performed on the local computer.

- lpSourceName
[in] Pointer to a null-terminated string that specifies the name of the source referenced by the returned handle. The source name must be a subkey of a logfile entry under the EventLog key in the registry. For example, WinApp is a valid source name if the registry has the following key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Event
Log\Application\WinApp

For more information, see Event Sources.

Return Values
If the function succeeds, the return value is a handle that can be used with the ReportEvent function.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Last update: 07 April 2006