RegisterEventCategory Example (Visual J++)

   

This example shows what a call to RegisterEventCategory 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 custom event category for the component.
// SAMPLE_SOURCE_GUID is the component for the category being registered.
// SAMPLE_CATEGORY_GUID is a unique GUID for the category (defined
// above); substitute the GUID for your component.

// If you want the category to appear in a hierarchy, specify a parent
// (DEBUG_EVENT_CATEGORY_ALL will be the parent of this category). 

// If you do not specify a parent, your category will appear at the top
// level in the Filter Editor.

private static void SampleRegisterCategory()
   {
      m_ESA.RegisterEventCategory( SAMPLE_SOURCE_GUID, SAMPLE_CATEGORY_GUID,
         DEBUG_EVENT_CATEGORY_ALL, "Sample Event Category",
         "Category for all sample events", null, 0 );
   }