RegisterCustomEvent Example (Visual Basic)

   Applies To

This example shows how to register a custom event. Refer to ISystemDebugEventInstall Example (Visual Basic) to see this code in context.

' Register a user-defined (custom) event.
Private Sub Sample_RegisterCustomEvent(ByVal sSourceGUID As String)
   Dim sCustomEventGUID As String
   Dim sCustomEventName As String
   Dim sCustomEventDescr As String
   Dim sIconFile As String, lIcon As Long

   ' sSourceGUID is the component for which to 
   ' register this custom event.
   ' You need to create a unique GUID for the event; substitute your own
   ' in the following line
   sCustomEventGUID = "{A84C4E72-1FD7-11D1-A573-00C04FD5B402}"
   ' Assign a name and description to the event
   sCustomEventName = "MyCustomDebugEvent1"
   sCustomEventDescr = "MyCustomDebugEvent1 Description"
   ' Pass the next two parameters empty
   sIconFile = "": lIcon = 0

   ' Run the method.
   ' This call assigns the defaults for event type and category.
   mESI.RegisterCustomEvent _
      sSourceGUID, _
      sCustomEventGUID, _
      sCustomEventName, _
      sCustomEventDescr, _
      DEBUG_EVENT_TYPE_DEFAULT, DEBUG_EVENT_CATEGORY_ALL, _
      sIconFile, _
      lIcon
End Sub