This example shows what a call to RegisterCustomEvent looks like. Refer to ISystemDebugEventInstall Example (Visual J++) to see the constant declarations and object creation code, as well as to see this code in a form you can run with minor modifications.
// Register a user-defined event for the component to generate.
// SAMPLE_SOURCE_GUID is the component that will generate the event
// being registered.
// SAMPLE_EVENT_GUID is a unique GUID for the event (defined in preceding
// code); substitute the GUID for your component.
private static void SampleRegisterCustomEvent()
{
m_ESA.RegisterCustomEvent( SAMPLE_SOURCE_GUID, SAMPLE_EVENT_GUID,
"Sample Event", "Event fired by the sample event source",
DEBUG_EVENT_TYPE_GENERIC, SAMPLE_CATEGORY_GUID, null, 0 );
}